[gtk/wip/matthiasc/popup5: 25/145] x11: Stop using child surface api



commit 8fc3f545b6d6881fa31e83d7010bcdc70e8e27ff
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Mar 23 00:14:00 2019 -0400

    x11: Stop using child surface api
    
    We no longer have child surfaces.
    Drop code that only makes sense in
    that case.

 gdk/x11/gdkdevicemanager-xi2.c | 24 ++----------------------
 gdk/x11/gdksurface-x11.c       |  2 +-
 gdk/x11/gdkxid.c               |  5 ++---
 3 files changed, 5 insertions(+), 26 deletions(-)
---
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 3cc4af03ea..35711053a9 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1183,7 +1183,7 @@ set_user_time (GdkEvent *event)
   GdkSurface *surface;
   guint32 time;
 
-  surface = gdk_surface_get_toplevel (event->any.surface);
+  surface = event->any.surface;
   g_return_if_fail (GDK_IS_SURFACE (surface));
 
   time = gdk_event_get_time (event);
@@ -1249,24 +1249,6 @@ translate_axes (GdkDevice       *device,
   return axes;
 }
 
-static gboolean
-is_parent_of (GdkSurface *parent,
-              GdkSurface *child)
-{
-  GdkSurface *w;
-
-  w = child;
-  while (w != NULL)
-    {
-      if (w == parent)
-        return TRUE;
-
-      w = gdk_surface_get_parent (w);
-    }
-
-  return FALSE;
-}
-
 static gboolean
 get_event_surface (GdkEventTranslator *translator,
                   XIEvent            *ev,
@@ -1308,9 +1290,7 @@ get_event_surface (GdkEventTranslator *translator,
             serial = _gdk_display_get_next_serial (display);
             info = _gdk_display_has_device_grab (display, device, serial);
 
-            if (info &&
-                (!is_parent_of (info->surface, surface) ||
-                 !info->owner_events))
+            if (info && !info->owner_events)
               {
                 /* Report key event against grab surface */
                 surface = info->surface;
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 530b80ff26..7e51686991 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -227,7 +227,7 @@ set_sync_counter(Display     *display,
 void
 gdk_x11_surface_pre_damage (GdkSurface *surface)
 {
-  GdkSurface *toplevel_surface = gdk_surface_get_toplevel (surface);
+  GdkSurface *toplevel_surface = surface;
   GdkSurfaceImplX11 *impl;
 
   if (!toplevel_surface || !SURFACE_IS_TOPLEVEL (toplevel_surface))
diff --git a/gdk/x11/gdkxid.c b/gdk/x11/gdkxid.c
index 93ca3c12a3..b08ffce7bf 100644
--- a/gdk/x11/gdkxid.c
+++ b/gdk/x11/gdkxid.c
@@ -62,8 +62,7 @@ _gdk_x11_display_add_window (GdkDisplay *display,
 
   g_hash_table_insert (display_x11->xid_ht, xid, data);
 
-  if (gdk_surface_get_parent (GDK_SURFACE (data)) == NULL)
-    display_x11->toplevels = g_list_prepend (display_x11->toplevels, data);
+  display_x11->toplevels = g_list_prepend (display_x11->toplevels, data);
 }
 
 void
@@ -81,7 +80,7 @@ _gdk_x11_display_remove_window (GdkDisplay *display,
     return;
 
   surface = g_hash_table_lookup (display_x11->xid_ht, &xid);
-  if (surface && gdk_surface_get_parent (surface) == NULL)
+  if (surface)
     display_x11->toplevels = g_list_remove (display_x11->toplevels, surface);
 
   g_hash_table_remove (display_x11->xid_ht, &xid);


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