diff options
author | Alexander Mikhaylenko <exalm7659@gmail.com> | 2019-10-12 23:53:19 +0500 |
---|---|---|
committer | Alexander Mikhaylenko <exalm7659@gmail.com> | 2021-03-01 15:38:08 +0500 |
commit | e523916f58a84c10ef8a30cf40e5c45dcbc24eab (patch) | |
tree | 27845c46a1989d0cc34467669239e4ec4e292bc6 | |
parent | 861d03aac06db0666a207e8daa7951ddf21b2849 (diff) | |
download | mutter-e523916f58a84c10ef8a30cf40e5c45dcbc24eab.tar.gz |
stack: Check workspace in get_default_focus_window()
Check against the window argument, instead of active workspace.
-rw-r--r-- | src/core/stack.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/stack.c b/src/core/stack.c index e1e73867d..8ceb72ef5 100644 --- a/src/core/stack.c +++ b/src/core/stack.c @@ -35,6 +35,7 @@ #include "core/main-private.h" #include "core/meta-workspace-manager-private.h" #include "core/window-private.h" +#include "core/workspace-private.h" #include "meta/group.h" #include "meta/prefs.h" #include "meta/workspace.h" @@ -1021,7 +1022,8 @@ window_contains_point (MetaWindow *window, } static gboolean -window_can_get_default_focus (MetaWindow *window) +window_can_get_default_focus (MetaWindow *window, + MetaWorkspace *workspace) { if (window->unmaps_pending > 0) return FALSE; @@ -1032,7 +1034,10 @@ window_can_get_default_focus (MetaWindow *window) if (!meta_window_is_focusable (window)) return FALSE; - if (!meta_window_should_be_showing (window)) + if (!meta_window_showing_on_its_workspace (window)) + return FALSE; + + if (!meta_window_located_on_workspace (window, workspace)) return FALSE; if (window->type == META_WINDOW_DOCK) @@ -1068,7 +1073,7 @@ get_default_focus_window (MetaStack *stack, if (window == not_this_one) continue; - if (!window_can_get_default_focus (window)) + if (!window_can_get_default_focus (window, workspace)) continue; if (must_be_at_point && !window_contains_point (window, root_x, root_y)) @@ -1139,7 +1144,7 @@ meta_stack_get_default_focus_candidates (MetaStack *stack, { GList *next = l->next; - if (!window_can_get_default_focus (l->data)) + if (!window_can_get_default_focus (l->data, workspace)) windows = g_list_delete_link (windows, l); l = next; |