Blame SOURCES/0001-stack-Don-t-prefer-windows-in-the-same-group-as-not_.patch

d1d875
From 8c97b4bc745dea0d15fcaf0e9e08093e172c882d Mon Sep 17 00:00:00 2001
d1d875
From: "Jasper St. Pierre" <jstpierre@mecheye.net>
d1d875
Date: Sun, 5 Jul 2015 14:31:17 -0700
d1d875
Subject: [PATCH] stack: Don't prefer windows in the same group as not_this_one
d1d875
d1d875
The only time we ever execute this code is when we're minimizing or
d1d875
hiding a window, in which case we should respect stacking order.
d1d875
d1d875
This fixes weird "bugs" where windows from the same app magically pop up
d1d875
over other windows.
d1d875
---
d1d875
 src/core/stack.c | 43 ++++---------------------------------------
d1d875
 1 file changed, 4 insertions(+), 39 deletions(-)
d1d875
d1d875
diff --git a/src/core/stack.c b/src/core/stack.c
d1d875
index f618ef2..32e252e 100644
d1d875
--- a/src/core/stack.c
d1d875
+++ b/src/core/stack.c
d1d875
@@ -1238,24 +1238,10 @@ get_default_focus_window (MetaStack     *stack,
d1d875
 {
d1d875
   /* Find the topmost, focusable, mapped, window.
d1d875
    * not_this_one is being unfocused or going away, so exclude it.
d1d875
-   * Also, prefer to focus transient parent of not_this_one,
d1d875
-   * or top window in same group as not_this_one.
d1d875
    */
d1d875
 
d1d875
-  MetaWindow *transient_parent;
d1d875
-  MetaWindow *topmost_in_group;
d1d875
-  MetaWindow *topmost_overall;
d1d875
-  MetaGroup *not_this_one_group;
d1d875
   GList *l;
d1d875
 
d1d875
-  transient_parent = NULL;
d1d875
-  topmost_in_group = NULL;
d1d875
-  topmost_overall = NULL;
d1d875
-  if (not_this_one)
d1d875
-    not_this_one_group = meta_window_get_group (not_this_one);
d1d875
-  else
d1d875
-    not_this_one_group = NULL;
d1d875
-
d1d875
   stack_ensure_sorted (stack);
d1d875
 
d1d875
   /* top of this layer is at the front of the list */
d1d875
@@ -1284,34 +1270,13 @@ get_default_focus_window (MetaStack     *stack,
d1d875
       if (must_be_at_point && !window_contains_point (window, root_x, root_y))
d1d875
         continue;
d1d875
 
d1d875
-      if (not_this_one != NULL)
d1d875
-        {
d1d875
-          if (transient_parent == NULL &&
d1d875
-              meta_window_get_transient_for (not_this_one) == window)
d1d875
-            transient_parent = window;
d1d875
-
d1d875
-          if (topmost_in_group == NULL &&
d1d875
-              not_this_one_group != NULL &&
d1d875
-              not_this_one_group == meta_window_get_group (window))
d1d875
-            topmost_in_group = window;
d1d875
-        }
d1d875
-
d1d875
-      if (topmost_overall == NULL && window->type != META_WINDOW_DOCK)
d1d875
-        topmost_overall = window;
d1d875
+      if (window->type == META_WINDOW_DOCK)
d1d875
+        continue;
d1d875
 
d1d875
-      /* We could try to bail out early here for efficiency in
d1d875
-       * some cases, but it's just not worth the code.
d1d875
-       */
d1d875
+      return window;
d1d875
     }
d1d875
 
d1d875
-  if (transient_parent)
d1d875
-    return transient_parent;
d1d875
-  else if (topmost_in_group)
d1d875
-    return topmost_in_group;
d1d875
-  else if (topmost_overall)
d1d875
-    return topmost_overall;
d1d875
-  else
d1d875
-    return NULL;
d1d875
+  return NULL;
d1d875
 }
d1d875
 
d1d875
 MetaWindow*
d1d875
-- 
d1d875
2.7.4
d1d875