[gtk/wip/otte/build: 6/6] x11: Remove XComposite




commit 0b3dc9a2f133ee45b4d2d473e80b3fdc379596f6
Author: Benjamin Otte <otte redhat com>
Date:   Fri Apr 2 03:05:40 2021 +0200

    x11: Remove XComposite
    
    It's only used during DND to allow use of the root window's cow window
    as a DND target, because apparently gnome-shell used to think that was a
    great idea to DND to the overview.
    
    Somebody complain to gnome-shell devs about it not being a good idea if
    they want it fixed.
    Potentially using Wayland is a better idea though.
    
    This reverts 85ae875dcbfcfa3fbdca857dc90467d39b9ff0c5
    
    Related: https://bugzilla.gnome.org/show_bug.cgi?id=601731

 config.h.meson           |  3 ---
 gdk/x11/gdkdisplay-x11.c | 22 ----------------------
 gdk/x11/gdkdisplay-x11.h |  2 --
 gdk/x11/gdkdrag-x11.c    | 27 ---------------------------
 gdk/x11/meson.build      |  1 -
 meson.build              |  4 +---
 6 files changed, 1 insertion(+), 58 deletions(-)
---
diff --git a/config.h.meson b/config.h.meson
index 56b215b012..f4f55122ee 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -124,9 +124,6 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #mesondefine HAVE_UNISTD_H
 
-/* Have the XCOMPOSITE X extension */
-#mesondefine HAVE_XCOMPOSITE
-
 /* Have the Xcursor library */
 #mesondefine HAVE_XCURSOR
 
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 67ffa7b09c..703219a912 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -69,10 +69,6 @@
 
 #include <X11/extensions/shape.h>
 
-#ifdef HAVE_XCOMPOSITE
-#include <X11/extensions/Xcomposite.h>
-#endif
-
 #ifdef HAVE_RANDR
 #include <X11/extensions/Xrandr.h>
 #endif
@@ -1454,24 +1450,6 @@ gdk_x11_display_open (const char *display_name)
 #endif
     display_x11->have_xfixes = FALSE;
 
-#ifdef HAVE_XCOMPOSITE
-  if (XCompositeQueryExtension (display_x11->xdisplay,
-                               &ignore, &ignore))
-    {
-      int major, minor;
-
-      XCompositeQueryVersion (display_x11->xdisplay, &major, &minor);
-
-      /* Prior to Composite version 0.4, composited windows clipped their
-       * parents, so you had to use IncludeInferiors to draw to the parent
-       * This isn't useful for our purposes, so require 0.4
-       */
-      display_x11->have_xcomposite = major > 0 || (major == 0 && minor >= 4);
-    }
-  else
-#endif
-    display_x11->have_xcomposite = FALSE;
-
   display_x11->have_shapes = FALSE;
   display_x11->have_input_shapes = FALSE;
 
diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h
index 5ffae57b74..8eada4a8db 100644
--- a/gdk/x11/gdkdisplay-x11.h
+++ b/gdk/x11/gdkdisplay-x11.h
@@ -71,8 +71,6 @@ struct _GdkX11Display
   gboolean have_xfixes;
   int xfixes_event_base;
 
-  gboolean have_xcomposite;
-
   gboolean have_randr12;
   gboolean have_randr13;
   gboolean have_randr15;
diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c
index 515848bd5e..88e65a2a2c 100644
--- a/gdk/x11/gdkdrag-x11.c
+++ b/gdk/x11/gdkdrag-x11.c
@@ -47,9 +47,6 @@
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
 #include <X11/extensions/shape.h>
-#ifdef HAVE_XCOMPOSITE
-#include <X11/extensions/Xcomposite.h>
-#endif
 
 #include <string.h>
 
@@ -518,9 +515,6 @@ gdk_surface_cache_new (GdkDisplay *display)
   Window xroot_window = GDK_DISPLAY_XROOTWIN (display);
   GdkChildInfoX11 *children;
   guint nchildren, i;
-#ifdef HAVE_XCOMPOSITE
-  Window cow;
-#endif
 
   GdkSurfaceCache *result = g_new (GdkSurfaceCache, 1);
 
@@ -571,27 +565,6 @@ gdk_surface_cache_new (GdkDisplay *display)
 
   g_free (children);
 
-#ifdef HAVE_XCOMPOSITE
-  /*
-   * Add the composite overlay window to the cache, as this can be a reasonable
-   * Xdnd proxy as well.
-   * This is only done when the screen is composited in order to avoid mapping
-   * the COW. We assume that the CM is using the COW (which is true for pretty
-   * much any CM currently in use).
-   */
-  if (gdk_display_is_composited (display))
-    {
-      gdk_x11_display_error_trap_push (display);
-      cow = XCompositeGetOverlayWindow (xdisplay, xroot_window);
-      gdk_surface_cache_add (result, cow, 0, 0,
-                           WidthOfScreen (GDK_X11_SCREEN (screen)->xscreen),
-                           HeightOfScreen (GDK_X11_SCREEN (screen)->xscreen),
-                           TRUE);
-      XCompositeReleaseOverlayWindow (xdisplay, xroot_window);
-      gdk_x11_display_error_trap_pop_ignored (display);
-    }
-#endif
-
   return result;
 }
 
diff --git a/gdk/x11/meson.build b/gdk/x11/meson.build
index 082fc9803a..725570a1dc 100644
--- a/gdk/x11/meson.build
+++ b/gdk/x11/meson.build
@@ -69,7 +69,6 @@ gdk_x11_deps = [
   xcursor_dep,
   xdamage_dep,
   xfixes_dep,
-  xcomposite_dep,
   xrandr_dep,
   xinerama_dep,
 ]
diff --git a/meson.build b/meson.build
index f3e4fa1a2a..8cabfefe7d 100644
--- a/meson.build
+++ b/meson.build
@@ -500,14 +500,12 @@ if x11_enabled
   xcursor_dep    = dependency('xcursor')
   xdamage_dep    = dependency('xdamage')
   xfixes_dep     = dependency('xfixes')
-  xcomposite_dep = dependency('xcomposite')
   fontconfig_dep = dependency('fontconfig')
 
-  x11_pkgs = ['fontconfig', 'x11', 'xext', 'xi', 'xrandr', 'xcursor', 'xdamage', 'xfixes', 'xcomposite', 
'xinerama']
+  x11_pkgs = ['fontconfig', 'x11', 'xext', 'xi', 'xrandr', 'xcursor', 'xdamage', 'xfixes', 'xinerama']
 
   cdata.set('HAVE_XCURSOR', 1)
   cdata.set('HAVE_XDAMAGE', 1)
-  cdata.set('HAVE_XCOMPOSITE', 1)
   cdata.set('HAVE_XFIXES', 1)
 
   if not cc.has_function('XkbQueryExtension', dependencies: x11_dep,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]