[mutter] display: Fix inconsistent behavior with demand attention



commit d2ca5cc26bf6a5a6c4860c02b4dc87402137ca71
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed Apr 17 12:28:57 2019 +0200

    display: Fix inconsistent behavior with demand attention
    
    When focus stealing prevention kicks in, mutter would set the demand
    attention flag on the window.
    
    Focus stealing prevention would also prevent the window from being
    raised and focused, which is expected as its precisely its purpose.
    
    Yet, when that occurs, the user expects the window which has just been
    prevented from being focused to be the next one in the MRU list, so
    that pressing [Alt]-[Tab] would raise and give focus to that window.
    
    This works fine when the window is placed on the primary monitor, but
    not when placed on another monitor, in which case the window which has
    been denied focus is placed ahead of the MRU list and pressing
    [Alt]-[Tab] would leave the focus on the current window.
    
    This is because of a mechanism in `meta_display_get_tab_list()` which
    forces the windows with the demand attention flag set to be placed first
    in the MRU list when they're placed on a workspace different from the
    current one.
    
    But because workspaces apply only to the primary monitor (by default),
    the windows placed on other outputs have their workspace set to `NULL`
    which forces them ahead of the MRU list by mistake.
    
    Fix this by using the appropriate `meta_window_located_on_workspace()
    function to check if the window is on another workspace.
    
    Closes: https://gitlab.gnome.org/GNOME/mutter/issues/523

 src/core/display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index e1477d3cd..0de99edb2 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2236,7 +2236,7 @@ meta_display_get_tab_list (MetaDisplay   *display,
         MetaWindow *l_window = w->data;
 
         if (l_window->wm_state_demands_attention &&
-            l_window->workspace != workspace &&
+            !meta_window_located_on_workspace (l_window, workspace) &&
             IN_TAB_CHAIN (l_window, type))
           tab_list = g_list_prepend (tab_list, l_window);
       }


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