mirror of
https://github.com/brl/mutter.git
synced 2025-03-30 23:23:47 +00:00
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.
This commit is contained in:
parent
a3fbbaabe8
commit
1ea8efdeda
@ -1239,24 +1239,10 @@ get_default_focus_window (MetaStack *stack,
|
|||||||
{
|
{
|
||||||
/* Find the topmost, focusable, mapped, window.
|
/* Find the topmost, focusable, mapped, window.
|
||||||
* not_this_one is being unfocused or going away, so exclude it.
|
* 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;
|
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);
|
stack_ensure_sorted (stack);
|
||||||
|
|
||||||
/* top of this layer is at the front of the list */
|
/* 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))
|
if (must_be_at_point && !window_contains_point (window, root_x, root_y))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (not_this_one != NULL)
|
if (window->type == META_WINDOW_DOCK)
|
||||||
{
|
continue;
|
||||||
if (transient_parent == NULL &&
|
|
||||||
meta_window_get_transient_for (not_this_one) == window)
|
|
||||||
transient_parent = window;
|
|
||||||
|
|
||||||
if (topmost_in_group == NULL &&
|
return window;
|
||||||
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;
|
|
||||||
|
|
||||||
/* We could try to bail out early here for efficiency in
|
|
||||||
* some cases, but it's just not worth the code.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transient_parent)
|
return NULL;
|
||||||
return transient_parent;
|
|
||||||
else if (topmost_in_group)
|
|
||||||
return topmost_in_group;
|
|
||||||
else if (topmost_overall)
|
|
||||||
return topmost_overall;
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaWindow*
|
MetaWindow*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user