From: Kruti Pendharkar Date: Wed, 24 Dec 2025 05:58:16 +0000 (-0800) Subject: Remove GTK2 related code from open-vm-tools X-Git-Tag: stable-13.1.0~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d440ac3ec7ce82022f048f4ba53c469ca596b708;p=thirdparty%2Fopen-vm-tools.git Remove GTK2 related code from open-vm-tools GTK4 is now supported by open-vm-tools, so GTK2 support is no longer required and has been removed. --- diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac index fcf74e71b..8ead1dd4b 100644 --- a/open-vm-tools/configure.ac +++ b/open-vm-tools/configure.ac @@ -246,14 +246,6 @@ AC_ARG_WITH( [with_gtk3="$withval"], [with_gtk3="auto"]) -AC_ARG_WITH( - gtk2, - AS_HELP_STRING( - [--without-gtk2], - [compiles without Gtk 2.0]), - [with_gtk2="$withval"], - [with_gtk2="auto"]) - # only one "with_gtkX" option allowed num_gtk_args=0 @@ -263,16 +255,12 @@ fi if test "$with_gtk3" = "yes" ; then (( num_gtk_args += 1 )) fi -if test "$with_gtk2" = "yes" ; then - (( num_gtk_args += 1 )) -fi if (( $num_gtk_args > 1 )); then AC_MSG_ERROR('cannot set multiple "with-gtkX" option') fi # any "with_gtkX option is ignored if "no_x" is set if test "$no_x" = "yes" ; then - with_gtk2="no" with_gtk3="no" with_gtk4="no" if (( $num_gtk_args > 0 )); then @@ -282,13 +270,8 @@ fi # use the gtk version if the option is set with "yes" explicitly if test "$with_gtk4" = "yes" ; then - with_gtk2="no" with_gtk3="no" elif test "$with_gtk3" = "yes" ; then - with_gtk2="no" - with_gtk4="no" -elif test "$with_gtk2" = "yes" ; then - with_gtk3="no" with_gtk4="no" fi @@ -1029,8 +1012,7 @@ else [with_gtk4="yes" have_gtk="yes" GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK4 -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" - with_gtk3="no" - with_gtk2="no"], + with_gtk3="no"], [AS_IF([test $with_gtk4 = "auto"], [AC_MSG_WARN([Gtk+ 4.0 library not found or devel package not found. Please configure without Gtk+ support (using --without-gtk4) or install the Gtk+ 4.0 devel package.]) with_gtk4="no"], @@ -1052,8 +1034,7 @@ else [gdk_display_get_default_group], [with_gtk3="yes" have_gtk="yes" - GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK3" - with_gtk2="no"], + GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK3"], [AS_IF([test $with_gtk3 = "auto"], [AC_MSG_WARN([Gtk+ 3.0 library not found or devel package not found. Please configure without Gtk+ support (using --without-gtk3) or install the Gtk+ 3.0 devel package.]) with_gtk3="no"], @@ -1062,28 +1043,8 @@ else ) fi - # Check whether we have gtk+ 2.0. - if test "$with_gtk2" != "no"; then - AC_VMW_CHECK_LIB([gtk-x11-2.0], - [GTK], - [gtk+-2.0], - [], - [2.4.0], - [gtk/gtk.h], - [gdk_display_get_default_group], - [with_gtk2="yes" - have_gtk="yes" - GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2"], - [AS_IF([test $with_gtk2 = "auto"], - [AC_MSG_WARN([Gtk+ 2.0 library not found or devel package not found. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package.]) - with_gtk2="no"], - [AC_MSG_ERROR([Gtk+ 2.0 library not found or devel package not found. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package.])] - )] - ) - fi - if test "$have_gtk" != "yes" && test "$no_x" != "yes"; then - AC_MSG_ERROR('need at least one of gtk2/gtk3/gtk4 available or build with --without-x to disable building desktop plugins') + AC_MSG_ERROR('need at least one of gtk3/gtk4 available or build with --without-x to disable building desktop plugins') fi # Now set gtkmm version after gtkN version is determined @@ -1095,7 +1056,6 @@ else [compiles without Gtkmm 4, sigc++, and related libs]), [with_gtkmm4="$withval"], [with_gtkmm4="yes"]) - with_gtkmm="no" with_gtkmm3="no" elif test "$with_gtk3" = "yes"; then AC_ARG_WITH( @@ -1105,22 +1065,11 @@ else [compiles without Gtkmm 3, sigc++, and related libs]), [with_gtkmm3="$withval"], [with_gtkmm3="yes"]) - with_gtkmm="no" - with_gtkmm4="no" - elif test "$with_gtk2" = "yes"; then - AC_ARG_WITH( - gtkmm, - AS_HELP_STRING( - [--without-gtkmm], - [compiles without Gtkmm, sigc++, and related libs]), - [with_gtkmm="$withval"], - [with_gtkmm="yes"]) - with_gtkmm3="no" with_gtkmm4="no" fi # - # Check for gtkmm 2.4.0 or greater. + # Check for gtkmm 3.0 or greater. # if test "$with_gtkmm4" != "no"; then AC_VMW_CHECK_LIBXX([gtkmm-4.0], @@ -1145,30 +1094,16 @@ else [], [SIGCXX_CPPFLAGS="$SIGCXX_CPPFLAGS -std=c++17"], [SIGCXX_CPPFLAGS="$SIGCXX_CPPFLAGS"]) - elif test "$with_gtkmm" != "no" -o "$with_gtkmm3" != "no"; then - if test "$with_gtkmm3" != "no"; then - AC_VMW_CHECK_LIBXX([gtkmm-3.0], - [GTKMM], - [gtkmm-3.0], - [], - [3.0.0], - [gtkmm.h], - [], - [GTKMM_CPPFLAGS="$GTKMM_CPPFLAGS -DHAVE_GTKMM"], - [AC_MSG_ERROR([gtkmm3 library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm3.])]) - - elif test "$with_gtkmm" != "no"; then - CUSTOM_GTKMM_CPPFLAGS="$CUSTOM_GTKMM_CPPFLAGS $GTK_CPPFLAGS" - AC_VMW_CHECK_LIBXX([gtkmm-2.4], - [GTKMM], - [gtkmm-2.4], - [], - [2.4.0], - [gtkmm.h], - [], - [GTKMM_CPPFLAGS="$GTKMM_CPPFLAGS -DHAVE_GTKMM"], - [AC_MSG_ERROR([gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm.])]) - fi + elif test "$with_gtkmm3" != "no"; then + AC_VMW_CHECK_LIBXX([gtkmm-3.0], + [GTKMM], + [gtkmm-3.0], + [], + [3.0.0], + [gtkmm.h], + [], + [GTKMM_CPPFLAGS="$GTKMM_CPPFLAGS -DHAVE_GTKMM"], + [AC_MSG_ERROR([gtkmm3 library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm3.])]) # # libsigc++-2.0 >= 2.5.1 requires C++11 support @@ -1191,7 +1126,7 @@ else [], [SIGCXX_CPPFLAGS="$SIGCXX_CPPFLAGS -std=c++11"], [SIGCXX_CPPFLAGS="$SIGCXX_CPPFLAGS"]) - fi + fi # End of checks for gtkmm3, gtkmm4 fi # End of checks for X libraries AC_CHECK_LIB( @@ -1734,7 +1669,7 @@ if test "x$enable_vmwgfxctrl" = "xauto"; then enable_vmwgfxctrl="no" fi -if test "$with_gtkmm" = "yes" || test "$with_gtkmm3" = "yes" || test "$with_gtkmm4" = "yes"; then +if test "$with_gtkmm3" = "yes" || test "$with_gtkmm4" = "yes"; then have_gtkmm="yes" else have_gtkmm="no" diff --git a/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11.c b/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11.c index d79e3f115..961f58571 100644 --- a/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11.c +++ b/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11.c @@ -19,7 +19,7 @@ /* * copyPasteCompatX11.c -- - * GTK2/GTK3 implementation only. The GTK4 implementation is in + * GTK3 implementation only. The GTK4 implementation is in * copyPasteCompatX11GTK4.c. * * Set of functions in guest side for copy/paste (both file and text). @@ -40,8 +40,8 @@ * selection text. */ -#if !defined(GTK2) && !defined(GTK3) -#error "This should only build with GTK2 or GTK3" +#if !defined(GTK3) +#error "This should only build with GTK3" #endif #define G_LOG_DOMAIN "dndcp" diff --git a/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11GTK4.c b/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11GTK4.c index 643d2c586..b9f4a5a6e 100644 --- a/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11GTK4.c +++ b/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11GTK4.c @@ -27,7 +27,7 @@ * Set of functions in this file are for guest side text copy/paste between * host and guest. Currently there are 4 versions copy/paste. * ** Version 1 is based on backdoor, supports only text copy/paste, - * available with GTK2/GTK3/GTK4. + * available with GTK3/GTK4. * ** Version 2/3/4 are all based on tools guestRPC. * *** Version 2 only existed for a certain period for compatibility with * pre-2000 windows guest and is deprecated. @@ -287,7 +287,7 @@ CopyPaste_RequestSelection(void) * * Set the clipboard uses CopyPaste_SetSelLength and set backdoor selection * with clipboard. If unavailable, set backdoor selection length to be 0. - * Unlike its GTK3/GTK2 implementation in copyPasteCompatX11.c, we could + * Unlike its GTK3 implementation in copyPasteCompatX11.c, we could * not compare with the timestamps so only the default clipboard is used. * * Results: diff --git a/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp b/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp index d45f1bcfc..31bb39121 100644 --- a/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp @@ -198,7 +198,7 @@ BlockService::Shutdown() */ CopyPasteDnDX11::CopyPasteDnDX11() : -#if defined(GTK2) || defined(GTK3) +#if defined(GTK3) m_main(NULL), #endif m_copyPasteUI(NULL), @@ -259,9 +259,6 @@ CopyPasteDnDX11::Init(ToolsAppCtx *ctx) gUserMainWidget = gtk_invisible_new(); #ifdef GTK3 gXDisplay = GDK_WINDOW_XDISPLAY(gtk_widget_get_window(gUserMainWidget)); -#endif -#ifdef GTK2 - gXDisplay = GDK_WINDOW_XDISPLAY(gUserMainWidget->window); #endif gXRoot = RootWindow(gXDisplay, DefaultScreen(gXDisplay)); #endif @@ -285,7 +282,7 @@ CopyPasteDnDX11::~CopyPasteDnDX11() { delete m_copyPasteUI; delete m_dndUI; -#if defined(GTK2) || defined(GTK3) +#if defined(GTK3) delete m_main; #endif diff --git a/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp b/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp index cb25cb397..d9c1f239b 100644 --- a/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp @@ -63,8 +63,8 @@ * ignore everything else. */ -#if !defined(GTK2) && !defined(GTK3) -#error "This could only build with GTK2 or GTK3" +#if !defined(GTK3) +#error "This could only build with GTK3" #endif #define G_LOG_DOMAIN "dndcp" diff --git a/open-vm-tools/services/plugins/dndcp/dndGuestBase/copyPasteDnDX11.h b/open-vm-tools/services/plugins/dndcp/dndGuestBase/copyPasteDnDX11.h index 7e80bf81e..8c95ea161 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuestBase/copyPasteDnDX11.h +++ b/open-vm-tools/services/plugins/dndcp/dndGuestBase/copyPasteDnDX11.h @@ -59,7 +59,7 @@ public: virtual void DnDVersionChanged(int version); virtual void CopyPasteVersionChanged(int version); virtual uint32 GetCaps(); -#if defined(GTK2) || defined(GTK3) +#if defined(GTK3) void SetUnityMode(Bool mode) {m_dndUI->SetUnityMode(mode);}; #endif void SetDnDAllowed(bool allowed); @@ -67,7 +67,7 @@ public: private: CopyPasteUIX11 *m_copyPasteUI; DnDUIX11 *m_dndUI; -#if defined(GTK2) || defined(GTK3) +#if defined(GTK3) Gtk::Main *m_main; #endif }; diff --git a/open-vm-tools/services/plugins/dndcp/xutils/xutils.cc b/open-vm-tools/services/plugins/dndcp/xutils/xutils.cc index af2ee2eca..b6cc640e6 100644 --- a/open-vm-tools/services/plugins/dndcp/xutils/xutils.cc +++ b/open-vm-tools/services/plugins/dndcp/xutils/xutils.cc @@ -18,7 +18,7 @@ *********************************************************/ #if GTK_MAJOR_VERSION > 3 -#error "This should only build with GTK2/GTK3, use xutilsGTK4.cc for GTK4" +#error "This should only build with GTK3, use xutilsGTK4.cc for GTK4" #endif #include #include