From 0487d672edb4518d9f326a85b2d3a54700ee1e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 5 Jun 2019 00:57:40 +0200 Subject: [PATCH] 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); }