shell/app: Do not try to activate OR windows

Since https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2029,
we track all windows, including OR ones. While this means that we can
now assume that any window can be matched to an app, it also means
we have to be more careful to not perform an unsupported action like
focus or raise on an OR window.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4973

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2131>
This commit is contained in:
Florian Müllner 2022-01-26 16:48:55 +01:00
parent 6f025822ba
commit f9037f5889

View File

@ -423,8 +423,19 @@ shell_app_activate_window (ShellApp *app,
return;
windows = shell_app_get_windows (app);
if (window == NULL && windows)
window = windows->data;
if (window == NULL)
{
for (GSList *l = windows; l; l = l->next)
{
MetaWindow *current_window = l->data;
if (!meta_window_is_override_redirect (current_window))
{
window = current_window;
break;
}
}
}
if (!g_slist_find (windows, window))
return;
@ -453,7 +464,9 @@ shell_app_activate_window (ShellApp *app,
{
MetaWindow *other_window = iter->data;
if (other_window != window && meta_window_get_workspace (other_window) == workspace)
if (other_window != window &&
!meta_window_is_override_redirect (other_window) &&
meta_window_get_workspace (other_window) == workspace)
meta_window_raise (other_window);
}
g_slist_free (windows_reversed);