diff --git a/src/core/window-private.h b/src/core/window-private.h index 186369d53..d7c33f821 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -563,6 +563,8 @@ struct _MetaWindow /* if TRUE, the we have the new form of sync request counter which * also handles application frames */ guint extended_sync_request_counter : 1; + + guint in_workspace_change : 1; }; struct _MetaWindowClass diff --git a/src/core/window.c b/src/core/window.c index 12121b455..e0f42e942 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -4552,6 +4552,14 @@ meta_window_focus (MetaWindow *window, "Setting input focus to window %s, input: %d focusable: %d", window->desc, window->input, meta_window_is_focusable (window)); + if (window->in_workspace_change) + { + meta_topic (META_DEBUG_FOCUS, + "Window %s is currently changing workspaces, not focusing it after all", + window->desc); + return; + } + if (window->display->grab_window && window->display->grab_window != window && window->display->grab_window->all_keys_grabbed && @@ -4671,6 +4679,8 @@ set_workspace_state (MetaWindow *window, !window->constructing) return; + window->in_workspace_change = TRUE; + if (window->workspace) meta_workspace_remove_window (window->workspace, window); else if (window->on_all_workspaces) @@ -4698,6 +4708,8 @@ set_workspace_state (MetaWindow *window, } } + window->in_workspace_change = FALSE; + if (!window->constructing) meta_window_update_appears_focused (window);