]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common source file change not directly applicable to open-vm-tools.
authorOliver Kurth <okurth@vmware.com>
Wed, 10 Apr 2019 21:14:54 +0000 (14:14 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 10 Apr 2019 21:14:54 +0000 (14:14 -0700)
open-vm-tools/lib/appUtil/appUtilX11.c

index 5f8621f493db1cbee32408986f7e9d3ecc3afe3b..bdc5a1a6a7c625aad7035f4c1ffbbec167030abf 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * 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
+
+
 /*
  *-----------------------------------------------------------------------------
  *
@@ -340,7 +339,13 @@ tryingOtherExts:
          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) {
@@ -348,8 +353,13 @@ tryingOtherExts:
          } 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);