[mutter] window: Avoid spurious focus-window changes when showing desktop



commit 2cc0d31b17bfe076e008195268a5d949cf92ab46
Author: Florian MÃllner <fmuellner gnome org>
Date:   Fri Oct 26 14:39:21 2012 +0200

    window: Avoid spurious focus-window changes when showing desktop
    
    When using the show-desktop shortcut with no desktop window, unshowing
    will focus the second-most-recently-used window. If we find a desktop
    window, it will be focused explicitly and everything works as expected;
    however without a desktop window, we end up hiding the focus window,
    which will use focus_default_window() with the not_this_one parameter
    to move focus away. We used to get away with this, as the not_this_one
    parameter was ignored until commit e257580b9484, now with bug 675982
    fixed, we need to explicitly handle the show-desktop case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686928

 src/core/window.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 06dba27..e99411b 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -3304,8 +3304,11 @@ meta_window_hide (MetaWindow *window)
        * active workspace; when it is not, we need to pass in NULL, so as to
        * focus the default window for the active workspace (this scenario
        * arises when we are switching workspaces).
+       * We also pass in NULL if we are in the process of hiding all non-desktop
+       * windows to avoid unexpected changes to the stacking order.
        */
-      if (my_workspace == window->screen->active_workspace)
+      if (my_workspace == window->screen->active_workspace &&
+          !my_workspace->showing_desktop)
         not_this_one = window;
 
       meta_workspace_focus_default_window (window->screen->active_workspace,



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