/*********************************************************
- * Copyright (C) 2008-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2019 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#include "posix.h"
#include "debug.h"
-#ifndef GTK2
-#ifndef GTK3
-#error "Gtk 2.0 or 3.0 is required"
-#endif
-#endif
-
#include <libgen.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <X11/Xatom.h>
#include <gdk-pixbuf-xlib/gdk-pixbuf-xlib.h>
+#if GTK_MAJOR_VERSION < 2
+#error "Gtk 2.0 or 3.0 is required"
+#endif
+
+
/*
*-----------------------------------------------------------------------------
*
pixbuf = gtk_icon_info_load_icon(iconInfo, NULL);
if (!pixbuf) {
+#if GTK_MAJOR_VERSION == 3
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
pixbuf = gtk_icon_info_get_builtin_pixbuf(iconInfo);
+#if GTK_MAJOR_VERSION == 3
+G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
}
if (pixbuf) {
} else {
Debug("WARNING: Not even a built-in pixbuf for icon %s\n", baseIconName);
}
-
- gtk_icon_info_free(iconInfo);
+#if GTK_MAJOR_VERSION == 3
+ if (iconInfo) {
+ g_object_unref(iconInfo);
+ }
+#else
+ gtk_icon_info_free(iconInfo);
+#endif
}
g_free(iconSizes);