tests/stacking: Alt+Tab focus+stacking test for globally active input
Gnome-shell uses meta_display_focus_default_window() when shell elements loose focus which is the case with Alt+Tab window switching. Globally active input clients don't immediately gain focus though so if meta_display_focus_default_window focuses a wrong window stacking and focus don't behave as expected. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2489>
This commit is contained in:
parent
7ac982d0d2
commit
c89bae8594
@ -443,6 +443,7 @@ stacking_tests = [
|
||||
'workspace-basic',
|
||||
'workspace-test',
|
||||
'always-on-top',
|
||||
'focus-default-window-globally-active-input',
|
||||
]
|
||||
|
||||
foreach stacking_test: stacking_tests
|
||||
|
@ -0,0 +1,20 @@
|
||||
new_client 0 x11
|
||||
create 0/1
|
||||
accept_focus 0/1 false
|
||||
can_take_focus 0/1 true
|
||||
accept_take_focus 0/1 true
|
||||
show 0/1
|
||||
|
||||
new_client 1 wayland
|
||||
create 1/1
|
||||
show 1/1
|
||||
|
||||
assert_stacking 0/1 1/1
|
||||
assert_focused 1/1
|
||||
|
||||
local_activate 0/1
|
||||
focus_default_window
|
||||
|
||||
wait
|
||||
assert_stacking 1/1 0/1
|
||||
assert_focused 0/1
|
@ -1171,6 +1171,16 @@ test_case_do (TestCase *test,
|
||||
else
|
||||
meta_window_unmake_above (window);
|
||||
}
|
||||
else if (strcmp (argv[0], "focus_default_window") == 0)
|
||||
{
|
||||
if (argc != 1)
|
||||
BAD_COMMAND("usage: %s", argv[0]);
|
||||
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
uint32_t timestamp = meta_display_get_current_time_roundtrip (display);
|
||||
|
||||
meta_display_focus_default_window (display, timestamp);
|
||||
}
|
||||
else
|
||||
{
|
||||
BAD_COMMAND("Unknown command %s", argv[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user