[mutter] stack: Don't prefer windows in the same group as not_this_one
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] stack: Don't prefer windows in the same group as not_this_one
- Date: Sun, 5 Jul 2015 21:34:42 +0000 (UTC)
commit 1ea8efdedac5871abff3a380c214bc7da6220ee9
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 | 43 ++++---------------------------------------
1 files changed, 4 insertions(+), 39 deletions(-)
---
diff --git a/src/core/stack.c b/src/core/stack.c
index 0d2b4f7..8b4dc00 100644
--- a/src/core/stack.c
+++ b/src/core/stack.c
@@ -1239,24 +1239,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 */
@@ -1285,34 +1271,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 &&
- meta_window_get_transient_for (not_this_one) == window)
- 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]