]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Remove GTK2 related code from open-vm-tools
authorKruti Pendharkar <kp025370@broadcom.com>
Wed, 24 Dec 2025 05:58:16 +0000 (21:58 -0800)
committerKruti Pendharkar <kp025370@broadcom.com>
Wed, 24 Dec 2025 05:58:16 +0000 (21:58 -0800)
GTK4 is now supported by open-vm-tools, so GTK2 support is no longer required
and has been removed.

open-vm-tools/configure.ac
open-vm-tools/services/plugins/dndcp/copyPasteCompatX11.c
open-vm-tools/services/plugins/dndcp/copyPasteCompatX11GTK4.c
open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp
open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp
open-vm-tools/services/plugins/dndcp/dndGuestBase/copyPasteDnDX11.h
open-vm-tools/services/plugins/dndcp/xutils/xutils.cc

index fcf74e71b43b9e20c7a59b84716bef67ffb520c7..8ead1dd4b59f432a8325e634449752da792f67dd 100644 (file)
@@ -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"
index d79e3f115b93c89312253fa3e104cf1ad5260150..961f58571b0edf8757aa26dde462d0d2ce073a66 100644 (file)
@@ -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"
 
index 643d2c5865923c3f8b9462e4bde163914918c7a4..b9f4a5a6efd5af8f29ad5b1d4cc93d18f1cd2f90 100644 (file)
@@ -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:
index d45f1bcfcc6de0f9c8de7f85a9c2eec08ee50377..31bb3912185a689960e9c7a28d19a94d2773003b 100644 (file)
@@ -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
 
index cb25cb397afc524ce08ed448ae49b4c411b5048e..d9c1f239b407e58db3d0941652d310edf16754a0 100644 (file)
@@ -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"
index 7e80bf81e96e9f0e9c25edf20cfd29a849db602f..8c95ea161e2c48a5ead39b36cccf378d66373b84 100644 (file)
@@ -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
 };
index af2ee2eca2db3fcb4439686681a2c2d9c8487475..b6cc640e66a088334f15553cea846fbc4830326d 100644 (file)
@@ -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 <cairomm/cairomm.h>
 #include <gdkmm.h>