[gtk+] Drop foreign window checks in Wayland



commit 6ba48bd0d8d0e2668ac716a95ccdfe16b5363b0f
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Aug 22 15:23:46 2017 -0400

    Drop foreign window checks in Wayland
    
    The wayland backend never creates foreign windows,
    so no need to check for this type of window.

 gdk/wayland/gdkwindow-wayland.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 14cda9b..ca7f54f 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -48,13 +48,9 @@ enum {
 
 static guint signals[LAST_SIGNAL];
 
-#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \
+#define WINDOW_IS_TOPLEVEL(window) \
   (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD)
 
-#define WINDOW_IS_TOPLEVEL(window)                   \
-  (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD &&   \
-   GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
-
 #define MAX_WL_BUFFER_SIZE (4083) /* 4096 minus header, string argument length and NUL byte */
 
 typedef struct _GdkWaylandWindow GdkWaylandWindow;
@@ -3059,7 +3055,7 @@ gdk_wayland_window_set_geometry_hints (GdkWindow         *window,
   int width, height;
 
   if (GDK_WINDOW_DESTROYED (window) ||
-      !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+      !WINDOW_IS_TOPLEVEL (window))
     return;
 
   impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
@@ -3248,7 +3244,7 @@ gdk_wayland_window_iconify (GdkWindow *window)
   GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
 
   if (GDK_WINDOW_DESTROYED (window) ||
-      !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+      !WINDOW_IS_TOPLEVEL (window))
     return;
 
   if (!impl->display_server.xdg_toplevel)
@@ -3261,7 +3257,7 @@ static void
 gdk_wayland_window_deiconify (GdkWindow *window)
 {
   if (GDK_WINDOW_DESTROYED (window) ||
-      !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+      !WINDOW_IS_TOPLEVEL (window))
     return;
 
   if (GDK_WINDOW_IS_MAPPED (window))
@@ -3420,7 +3416,7 @@ gdk_wayland_window_begin_resize_drag (GdkWindow     *window,
   uint32_t resize_edges, serial;
 
   if (GDK_WINDOW_DESTROYED (window) ||
-      !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
+      !WINDOW_IS_TOPLEVEL (window))
     return;
 
   switch (edge)
@@ -3529,9 +3525,7 @@ gdk_wayland_window_destroy_notify (GdkWindow *window)
 {
   if (!GDK_WINDOW_DESTROYED (window))
     {
-      if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
-        g_warning ("GdkWindow %p unexpectedly destroyed", window);
-
+      g_warning ("GdkWindow %p unexpectedly destroyed", window);
       _gdk_window_destroy (window, TRUE);
     }
 


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