[mutter] tests/stacking: Alt+Tab focus+stacking test for globally active input
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] tests/stacking: Alt+Tab focus+stacking test for globally active input
- Date: Tue, 20 Sep 2022 17:48:31 +0000 (UTC)
commit c89bae859481347cd501ad02245cae055c8563e4
Author: Sebastian Wick <sebastian wick redhat com>
Date: Wed Jul 13 18:21:56 2022 +0200
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>
src/tests/meson.build | 1 +
...cus-default-window-globally-active-input.metatest | 20 ++++++++++++++++++++
src/tests/test-runner.c | 10 ++++++++++
3 files changed, 31 insertions(+)
---
diff --git a/src/tests/meson.build b/src/tests/meson.build
index bc0d535c56..0ffd9a20ef 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 0000000000..5ebf2855d8
--- /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 845a5441af..c9a87516ca 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]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]