[mutter/gnome-3-32] tests, stacking: Add tests with no-input and no-take-focus windows



commit afcea966c000707e3b8a9e3fbf6c4260349eb58a
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Tue Nov 13 07:48:53 2018 +0100

    tests, stacking: Add tests with no-input and no-take-focus windows
    
    When a window with no frame, that doesn't accept focus and that has no
    take-focus atom set is destroyed, we ended up in not changing the current_focus
    window, causing a crash.
    
    Added test cases that verify this situation.
    
    Related to https://gitlab.gnome.org/GNOME/mutter/issues/308
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
    (cherry picked from commit 2fc7760ceed6f948d4f3c1dd74d4e57c7df05eea)

 src/tests/meson.build                              |  3 +++
 ...ransient-no-input-no-take-focus-parent.metatest | 21 ++++++++++++++++++++
 ...ansient-no-input-no-take-focus-parents.metatest | 23 ++++++++++++++++++++++
 .../closed-transient-no-input-parent.metatest      | 20 +++++++++++++++++++
 4 files changed, 67 insertions(+)
---
diff --git a/src/tests/meson.build b/src/tests/meson.build
index 6be77c929..d4ea97301 100644
--- a/src/tests/meson.build
+++ b/src/tests/meson.build
@@ -105,6 +105,9 @@ headless_start_test = executable('mutter-headless-start-test',
 stacking_tests = files([
   'stacking/basic-x11.metatest',
   'stacking/basic-wayland.metatest',
+  'stacking/closed-transient-no-input-no-take-focus-parent.metatest',
+  'stacking/closed-transient-no-input-no-take-focus-parents.metatest',
+  'stacking/closed-transient-no-input-parent.metatest',
   'stacking/minimized.metatest',
   'stacking/mixed-windows.metatest',
   'stacking/set-parent.metatest',
diff --git a/src/tests/stacking/closed-transient-no-input-no-take-focus-parent.metatest 
b/src/tests/stacking/closed-transient-no-input-no-take-focus-parent.metatest
new file mode 100644
index 000000000..4249c32b9
--- /dev/null
+++ b/src/tests/stacking/closed-transient-no-input-no-take-focus-parent.metatest
@@ -0,0 +1,21 @@
+new_client 1 x11
+create 1/1
+show 1/1
+
+create 1/2 csd
+set_parent 1/2 1
+can_take_focus 1/2 false
+accept_focus 1/2 false
+show 1/2
+
+create 1/3 csd
+set_parent 1/3 2
+show 1/3
+
+wait
+assert_stacking 1/1 1/2 1/3
+
+destroy 1/3
+
+wait
+assert_stacking 1/1 1/2
diff --git a/src/tests/stacking/closed-transient-no-input-no-take-focus-parents.metatest 
b/src/tests/stacking/closed-transient-no-input-no-take-focus-parents.metatest
new file mode 100644
index 000000000..a61c64055
--- /dev/null
+++ b/src/tests/stacking/closed-transient-no-input-no-take-focus-parents.metatest
@@ -0,0 +1,23 @@
+new_client 1 x11
+create 1/1
+accept_focus 1/1 false
+can_take_focus 1/1 false
+show 1/1
+
+create 1/2 csd
+set_parent 1/2 1
+can_take_focus 1/2 false
+accept_focus 1/2 false
+show 1/2
+
+create 1/3 csd
+set_parent 1/3 2
+show 1/3
+
+wait
+assert_stacking 1/1 1/2 1/3
+
+destroy 1/3
+wait
+
+assert_stacking 1/1 1/2
diff --git a/src/tests/stacking/closed-transient-no-input-parent.metatest 
b/src/tests/stacking/closed-transient-no-input-parent.metatest
new file mode 100644
index 000000000..4cadb2350
--- /dev/null
+++ b/src/tests/stacking/closed-transient-no-input-parent.metatest
@@ -0,0 +1,20 @@
+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_stacking 1/1 1/2 1/3
+
+destroy 1/3
+
+wait
+assert_stacking 1/1 1/2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]