[mutter/gnome-3-38] core: Be more selective looking for a focusable ancestor



commit 5fab0e10010ecbf8d3ba0635e0462d8cd2bb132d
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed Dec 16 17:59:02 2020 +0100

    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>

 src/core/workspace.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/core/workspace.c b/src/core/workspace.c
index 4c01c8de73..a94f92ced7 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))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]