From 0b9f5ae75b1aaa14a0c4d440e18726ecaf4be402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 15 Aug 2023 23:40:39 +0200 Subject: [PATCH] tests: Add test case for restoring focus after overview This is a test case for https://gitlab.gnome.org/GNOME/mutter/-/issues/2690. Part-of: --- src/tests/meson.build | 1 + src/tests/stacking/overview-focus.metatest | 44 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/tests/stacking/overview-focus.metatest diff --git a/src/tests/meson.build b/src/tests/meson.build index 7383ffbde..64cb3046e 100644 --- a/src/tests/meson.build +++ b/src/tests/meson.build @@ -696,6 +696,7 @@ stacking_tests = [ 'workspace-unmanaging-window', 'click-to-focus-and-raise', 'workspace-only-on-primary-focus', + 'overview-focus', ] foreach stacking_test: stacking_tests diff --git a/src/tests/stacking/overview-focus.metatest b/src/tests/stacking/overview-focus.metatest new file mode 100644 index 000000000..07dfe5ac4 --- /dev/null +++ b/src/tests/stacking/overview-focus.metatest @@ -0,0 +1,44 @@ +new_client w wayland + +create w/1 +show w/1 +wait +assert_focused w/1 +hide w/1 +destroy w/1 + +toggle_overview + +create w/1 +show w/1 +wait +assert_focused none + +toggle_overview + +assert_focused w/1 +hide w/1 +destroy w/1 + + +new_client x x11 + +create x/1 +show x/1 +wait +assert_focused x/1 +hide x/1 +destroy x/1 + +toggle_overview + +create x/1 +show x/1 +wait +assert_focused none + +toggle_overview + +assert_focused x/1 +hide x/1 +destroy x/1