[mutter] x11-display: Handle mapped XIDs per type



commit 0487d672edb4518d9f326a85b2d3a54700ee1e51
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Wed Jun 5 00:57:40 2019 +0200

    x11-display: Handle mapped XIDs per type
    
    Starting from commit 7713006f5, during X11 disposition we also unmanage the
    windows using the xids hash table values list.
    However, this is also populated by the X11 Meta barrier implementation and then
    contains both Windows and Barriers.
    
    So when going through the values list, check whether we're handling a window or
    a barrier and based on that, unmanage or destroy it.
    
    Fixes https://gitlab.gnome.org/GNOME/mutter/issues/624
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/605

 src/x11/meta-x11-display.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c
index 665600938..3174d8c4e 100644
--- a/src/x11/meta-x11-display.c
+++ b/src/x11/meta-x11-display.c
@@ -99,7 +99,6 @@ static void
 meta_x11_display_unmanage_windows (MetaX11Display *x11_display)
 {
   GList *windows, *l;
-  MetaWindow *window;
 
   if (!x11_display->xids)
     return;
@@ -109,9 +108,17 @@ meta_x11_display_unmanage_windows (MetaX11Display *x11_display)
 
   for (l = windows; l; l = l->next)
     {
-      window = l->data;
-      if (!window->unmanaging)
-        meta_window_unmanage (window, META_CURRENT_TIME);
+      if (META_IS_WINDOW (l->data))
+        {
+          MetaWindow *window = l->data;
+
+          if (!window->unmanaging)
+            meta_window_unmanage (window, META_CURRENT_TIME);
+        }
+      else if (META_IS_BARRIER (l->data))
+        meta_barrier_destroy (META_BARRIER (l->data));
+      else
+        g_assert_not_reached ();
     }
   g_list_free_full (windows, g_object_unref);
 }


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