diff --git a/src/tests/meson.build b/src/tests/meson.build index bc0d535c5..0ffd9a20e 100644 --- a/src/tests/meson.build +++ b/src/tests/meson.build @@ -443,6 +443,7 @@ stacking_tests = [ 'workspace-basic', 'workspace-test', 'always-on-top', + 'focus-default-window-globally-active-input', ] foreach stacking_test: stacking_tests diff --git a/src/tests/stacking/focus-default-window-globally-active-input.metatest b/src/tests/stacking/focus-default-window-globally-active-input.metatest new file mode 100644 index 000000000..5ebf2855d --- /dev/null +++ b/src/tests/stacking/focus-default-window-globally-active-input.metatest @@ -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 diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c index 845a5441a..c9a87516c 100644 --- a/src/tests/test-runner.c +++ b/src/tests/test-runner.c @@ -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]);