MetaWindow: don't set focus to unmanaged window

Closing the last window causes the no-focus window to gain
focus, which causes mutter to unfocus the just closed window,
and that crashes. As focusing a window that is about to be
destroyed does not make sense, avoid a crash in this case.

Note: this is probably a reference counting bug in MetaWayland
actually.
This commit is contained in:
Giovanni Campagna 2013-07-29 10:15:01 +02:00
parent 62442cf0ce
commit 63fdf8bcb8

View File

@ -7399,6 +7399,9 @@ void
meta_window_set_focused_internal (MetaWindow *window, meta_window_set_focused_internal (MetaWindow *window,
gboolean focused) gboolean focused)
{ {
if (window->unmanaging)
return;
if (focused) if (focused)
{ {
window->has_focus = TRUE; window->has_focus = TRUE;