window: Emit an error and return when trying to activate an unmanaged

If something (i.e. gnome-shell or an extension) tries to activate an unmanaged
window, we should warn about this and avoid to perform further actions as this
could lead to a crash of mutter, since the window has not valid flags (like
workspace) set anymore at this stage.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/580

https://gitlab.gnome.org/GNOME/mutter/merge_requests/564


(cherry picked from commit a6fc656e91)
This commit is contained in:
Marco Trevisan (Treviño) 2019-05-03 18:10:47 +00:00 committed by Marco Trevisan
parent 8abd1b0092
commit a9322c81af

View File

@ -3639,6 +3639,13 @@ meta_window_activate_full (MetaWindow *window,
{ {
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager; MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
gboolean allow_workspace_switch; gboolean allow_workspace_switch;
if (window->unmanaging)
{
g_warning ("Trying to activate unmanaged window '%s'", window->desc);
return;
}
meta_topic (META_DEBUG_FOCUS, meta_topic (META_DEBUG_FOCUS,
"_NET_ACTIVE_WINDOW message sent for %s at time %u " "_NET_ACTIVE_WINDOW message sent for %s at time %u "
"by client type %u.\n", "by client type %u.\n",