[metacity] stack: don't prefer windows in the same group as not_this_one



commit fff026c9258e6b6b03a06c43286d828257a9121d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Jul 5 14:31:17 2015 -0700

    stack: don't prefer windows in the same group as not_this_one
    
    The only time we ever execute this code is when we're minimizing or
    hiding a window, in which case we should respect stacking order.
    
    This fixes weird "bugs" where windows from the same app magically pop up
    over other windows.

 src/core/stack.c |   44 ++++----------------------------------------
 1 files changed, 4 insertions(+), 40 deletions(-)
---
diff --git a/src/core/stack.c b/src/core/stack.c
index 271e7b3..584eabc 100644
--- a/src/core/stack.c
+++ b/src/core/stack.c
@@ -1401,24 +1401,10 @@ get_default_focus_window (MetaStack     *stack,
 {
   /* Find the topmost, focusable, mapped, window.
    * not_this_one is being unfocused or going away, so exclude it.
-   * Also, prefer to focus transient parent of not_this_one,
-   * or top window in same group as not_this_one.
    */
 
-  MetaWindow *transient_parent;
-  MetaWindow *topmost_in_group;
-  MetaWindow *topmost_overall;
-  MetaGroup *not_this_one_group;
   GList *l;
 
-  transient_parent = NULL;
-  topmost_in_group = NULL;
-  topmost_overall = NULL;
-  if (not_this_one)
-    not_this_one_group = meta_window_get_group (not_this_one);
-  else
-    not_this_one_group = NULL;
-
   stack_ensure_sorted (stack);
 
   /* top of this layer is at the front of the list */
@@ -1450,35 +1436,13 @@ get_default_focus_window (MetaStack     *stack,
       if (must_be_at_point && !window_contains_point (window, root_x, root_y))
         continue;
 
-      if (not_this_one != NULL)
-        {
-          if (transient_parent == NULL &&
-              not_this_one->xtransient_for != None &&
-              not_this_one->xtransient_for == window->xwindow)
-            transient_parent = window;
-
-          if (topmost_in_group == NULL &&
-              not_this_one_group != NULL &&
-              not_this_one_group == meta_window_get_group (window))
-            topmost_in_group = window;
-        }
-
-      if (topmost_overall == NULL && window->type != META_WINDOW_DOCK)
-        topmost_overall = window;
+      if (window->type == META_WINDOW_DOCK)
+        continue;
 
-      /* We could try to bail out early here for efficiency in
-       * some cases, but it's just not worth the code.
-       */
+      return window;
     }
 
-  if (transient_parent)
-    return transient_parent;
-  else if (topmost_in_group)
-    return topmost_in_group;
-  else if (topmost_overall)
-    return topmost_overall;
-  else
-    return NULL;
+  return NULL;
 }
 
 MetaWindow*


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