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.
This commit is contained in:
Florian Müllner 2014-10-07 17:13:15 +02:00
parent 924eaac358
commit c0bdb3018b

View File

@ -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 ||