mirror of
https://github.com/brl/mutter.git
synced 2025-08-06 16:44:40 +00:00
window-x11: Focus the default window with delay while waiting for take-focus
When requesting to a take-focus window to acquire the input, the client may or may not respond with a SetInputFocus (this doesn't happen for no-input gtk windows in fact [to be fixed there too]), in such case we were unsetting the focus while waiting the reply. In case the client won't respond, we wait for a small delay (set to 250 ms) for the take-focus window to grab the input focus before setting it to the default window. Added a test for this behavior and for the case in which a window takes the focus meanwhile we're waiting to focus the default window. https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
This commit is contained in:

committed by
Jonas Ådahl

parent
6022b23923
commit
f71151a5dd
@@ -114,6 +114,7 @@ stacking_tests = [
|
||||
'closed-transient-no-input-no-take-focus-parent',
|
||||
'closed-transient-no-input-no-take-focus-parents',
|
||||
'closed-transient-no-input-parent',
|
||||
'closed-transient-no-input-parent-delayed-focus-default-cancelled',
|
||||
'minimized',
|
||||
'mixed-windows',
|
||||
'set-parent',
|
||||
|
@@ -0,0 +1,36 @@
|
||||
new_client 2 x11
|
||||
create 2/1
|
||||
show 2/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
|
||||
show 1/3
|
||||
|
||||
wait
|
||||
assert_focused 1/3
|
||||
assert_stacking 2/1 1/1 1/2 1/3
|
||||
|
||||
destroy 1/3
|
||||
sleep 10
|
||||
|
||||
assert_focused none
|
||||
assert_stacking 2/1 1/1 1/2
|
||||
|
||||
activate 2/1
|
||||
wait
|
||||
|
||||
assert_focused 2/1
|
||||
assert_stacking 1/1 1/2 2/1
|
||||
|
||||
sleep 250
|
||||
assert_focused 2/1
|
||||
assert_stacking 1/1 1/2 2/1
|
@@ -1,3 +1,7 @@
|
||||
new_client 2 x11
|
||||
create 2/1
|
||||
show 2/1
|
||||
|
||||
new_client 1 x11
|
||||
create 1/1
|
||||
show 1/1
|
||||
@@ -12,9 +16,15 @@ set_parent 1/3 2
|
||||
show 1/3
|
||||
|
||||
wait
|
||||
assert_stacking 1/1 1/2 1/3
|
||||
assert_focused 1/3
|
||||
assert_stacking 2/1 1/1 1/2 1/3
|
||||
|
||||
destroy 1/3
|
||||
dispatch
|
||||
|
||||
wait
|
||||
assert_stacking 1/1 1/2
|
||||
assert_focused none
|
||||
assert_stacking 2/1 1/1 1/2
|
||||
|
||||
sleep 250
|
||||
assert_focused 1/1
|
||||
assert_stacking 2/1 1/1 1/2
|
||||
|
Reference in New Issue
Block a user