diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2020-12-16 17:59:02 +0100 |
---|---|---|
committer | Jonas Ã…dahl <jadahl@gmail.com> | 2020-12-18 22:43:03 +0100 |
commit | 5fab0e10010ecbf8d3ba0635e0462d8cd2bb132d (patch) | |
tree | 2f856575eca1109996f24251b796f7fb785b9dee | |
parent | e4d8e4b9f7d16c6bf4c54cc2017b8670f1d2c291 (diff) | |
download | mutter-5fab0e10010ecbf8d3ba0635e0462d8cd2bb132d.tar.gz |
core: Be more selective looking for a focusable ancestor
find_focusable_ancestor() may pick an ancestor window which is not
mapped or hidden, and setting focus on that window will fail.
Be a tad more selective when looking for a focusable ancestor, to reduce
the chance of meta_window_focus() not focusing the happy chosen one.
(cherry picked from commit 76d1a64204181f4da82d9614fe59daf350d5dfda)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1650>
-rw-r--r-- | src/core/workspace.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/workspace.c b/src/core/workspace.c index 4c01c8de7..a94f92ced 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -1345,7 +1345,10 @@ find_focusable_ancestor (MetaWindow *window, { MetaWorkspaceFocusableAncestorData *data = user_data; - if (!window->unmanaging && meta_window_is_focusable (window) && + if (!window->unmanaging && + window->mapped && + !window->hidden && + meta_window_is_focusable (window) && meta_window_located_on_workspace (window, data->workspace) && meta_window_showing_on_its_workspace (window)) { |