From: Oliver Kurth Date: Wed, 10 Apr 2019 21:14:54 +0000 (-0700) Subject: Common source file change not directly applicable to open-vm-tools. X-Git-Tag: stable-11.0.0~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf05c47b06af90a7bb7c5d561fb425ba2ebc0b47;p=thirdparty%2Fopen-vm-tools.git Common source file change not directly applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/appUtil/appUtilX11.c b/open-vm-tools/lib/appUtil/appUtilX11.c index 5f8621f49..bdc5a1a6a 100644 --- a/open-vm-tools/lib/appUtil/appUtilX11.c +++ b/open-vm-tools/lib/appUtil/appUtilX11.c @@ -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 @@ -32,12 +32,6 @@ #include "posix.h" #include "debug.h" -#ifndef GTK2 -#ifndef GTK3 -#error "Gtk 2.0 or 3.0 is required" -#endif -#endif - #include #include #include @@ -46,6 +40,11 @@ #include #include +#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);