From c0bdb3018b6b839a08a2282e84bd4fe2aa45887f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 7 Oct 2014 17:13:15 +0200 Subject: [PATCH] display: Do not include unmanaging windows in list_windows() There's a small window before a window that is being unmanaged is unregistered with the display. The MetaScreen::window-left-monitor and MetaWorkspace::window-removed emissions fall right into that window, so code that runs in that time may well be out of our control; we can make sure that the method it can use to get an updated list of windows no longer contains the destroyed window though, which is a much better option than expecting everyone to filter the list themselves. --- src/core/display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index 14bcebe2e..4669593bd 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1007,7 +1007,7 @@ meta_display_list_windows (MetaDisplay *display, { MetaWindow *window = value; - if (!META_IS_WINDOW (window)) + if (!META_IS_WINDOW (window) || window->unmanaging) continue; if (!window->override_redirect || @@ -1020,7 +1020,7 @@ meta_display_list_windows (MetaDisplay *display, { MetaWindow *window = value; - if (!META_IS_WINDOW (window)) + if (!META_IS_WINDOW (window) || window->unmanaging) continue; if (!window->override_redirect ||