mirror of
https://github.com/brl/mutter.git
synced 2024-11-27 10:30:47 -05:00
window-x11: Accept any focusable window as fallback focus
As per commitf71151a5
we were ignoring WM_TAKE_FOCUS-only windows as focus targets, however this might end-up in an infinite loop if there are multiple non-input windows stacked. So, accept any focusable window as fallback focus target even if it's a take-focus one (that might not reply to the request). Added a stacking test to verify this. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/660 https://gitlab.gnome.org/GNOME/mutter/merge_requests/669 (cherry picked from commitc327b2df95
)
This commit is contained in:
parent
a6df771747
commit
7951ddab40
@ -19,6 +19,7 @@ dist_stacking_DATA = \
|
|||||||
tests/stacking/closed-transient-no-input-no-take-focus-parents.metatest \
|
tests/stacking/closed-transient-no-input-no-take-focus-parents.metatest \
|
||||||
tests/stacking/closed-transient-no-input-parent.metatest \
|
tests/stacking/closed-transient-no-input-parent.metatest \
|
||||||
tests/stacking/closed-transient-no-input-parent-delayed-focus-default-cancelled.metatest \
|
tests/stacking/closed-transient-no-input-parent-delayed-focus-default-cancelled.metatest \
|
||||||
|
tests/stacking/closed-transient-no-input-parents.metatest \
|
||||||
tests/stacking/minimized.metatest \
|
tests/stacking/minimized.metatest \
|
||||||
tests/stacking/mixed-windows.metatest \
|
tests/stacking/mixed-windows.metatest \
|
||||||
tests/stacking/set-parent.metatest \
|
tests/stacking/set-parent.metatest \
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
new_client 0 x11
|
||||||
|
create 0/1
|
||||||
|
show 0/1
|
||||||
|
|
||||||
|
new_client 1 x11
|
||||||
|
create 1/1
|
||||||
|
show 1/1
|
||||||
|
|
||||||
|
create 1/2 csd
|
||||||
|
set_parent 1/2 1
|
||||||
|
accept_focus 1/2 false
|
||||||
|
show 1/2
|
||||||
|
|
||||||
|
create 1/3 csd
|
||||||
|
set_parent 1/3 2
|
||||||
|
accept_focus 1/3 false
|
||||||
|
show 1/3
|
||||||
|
|
||||||
|
create 1/4 csd
|
||||||
|
set_parent 1/4 3
|
||||||
|
accept_focus 1/4 false
|
||||||
|
show 1/4
|
||||||
|
|
||||||
|
create 1/5 csd
|
||||||
|
set_parent 1/5 3
|
||||||
|
show 1/5
|
||||||
|
|
||||||
|
wait
|
||||||
|
assert_focused 1/5
|
||||||
|
assert_stacking 0/1 1/1 1/2 1/3 1/4 1/5
|
||||||
|
|
||||||
|
destroy 1/5
|
||||||
|
dispatch
|
||||||
|
|
||||||
|
assert_focused none
|
||||||
|
assert_stacking 0/1 1/1 1/2 1/3 1/4
|
||||||
|
|
||||||
|
sleep 250
|
||||||
|
assert_focused none
|
||||||
|
assert_stacking 0/1 1/1 1/2 1/3 1/4
|
||||||
|
|
||||||
|
destroy 1/3
|
||||||
|
wait
|
||||||
|
|
||||||
|
assert_focused none
|
||||||
|
assert_stacking 0/1 1/1 1/2 1/4
|
@ -852,7 +852,7 @@ meta_window_x11_focus (MetaWindow *window,
|
|||||||
if (!focus_window)
|
if (!focus_window)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (focus_window->input)
|
if (focus_window->input || focus_window->take_focus)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (focus_window->shaded && focus_window->frame)
|
if (focus_window->shaded && focus_window->frame)
|
||||||
|
Loading…
Reference in New Issue
Block a user