summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars R. Damerow <[email protected]>2024-02-08 18:00:03 -0800
committerraveit65 <[email protected]>2024-02-14 01:55:50 +0100
commitc6fb9cc87bec7dd7abcacc3fd1df080eda1fb6c1 (patch)
treeb090c8a55e15d956db6ea71d80f500f694c74960
parent84be1dc64ffed125541d8ef845b0b58f5cd9bdb6 (diff)
downloadmarco-c6fb9cc87bec7dd7abcacc3fd1df080eda1fb6c1.tar.bz2
marco-c6fb9cc87bec7dd7abcacc3fd1df080eda1fb6c1.tar.xz
workspace: ignore not_this_one if not in current workspace
When the active workspace is changed, marco figures out which window should get focus by calling `focus_ancestor_or_top_window`. In some cases that call might include a window that should not get focus as `not_this_one`. When `not_this_one` refers to a window, the function will check to see if it has a parent, and if it does, it will ignore the new workspace's `mru_list` and will focus that parent window. However, it doesn't check to see if the parent window is actually on the new workspace. If the parent isn't on the new workspace, focusing it will drag it over, including the transient window that was supposed to be ignored. This isn't the result a user would likely expect, and is made more confusing by the parent window being minimized, stuck that way until the user switches to another workspace and back. This change makes `focus_ancestor_or_top_window` ignore the `not_this_one` window if it isn't on the new workspace's `mru_list`. Instead it will just search the new workspace's `mru_list` for a window to focus.
-rw-r--r--src/core/workspace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/workspace.c b/src/core/workspace.c
index ce6080ba..3b640cd1 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -1049,8 +1049,9 @@ focus_ancestor_or_top_window (MetaWorkspace *workspace,
meta_topic (META_DEBUG_FOCUS,
"Focusing MRU window\n");
- /* First, check to see if we need to focus an ancestor of a window */
- if (not_this_one)
+ /* First, check to see if we need to focus an ancestor of a window
+ * that exists in this workspace */
+ if (not_this_one && g_list_find (workspace->mru_list, not_this_one) != NULL)
{
MetaWindow *ancestor;
ancestor = NULL;