diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2022-08-03 23:10:00 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2022-08-11 13:52:44 +0200 |
commit | 389e46115622f17fa82e3419ddb94b04bb10bfd1 (patch) | |
tree | e7497e43728da648bc9356904cf088aece0e318b | |
parent | 16ac9567dbd166746d2368a73dc3b4b417615bba (diff) | |
download | mutter-389e46115622f17fa82e3419ddb94b04bb10bfd1.tar.gz |
tests: Test hotplugs when having unmapped Wayland window
This checks that an unmapped but created Wayland window correctly handle
monitor changes. This is specifically added to test an edge case causing
a crash with the following backtrace:
```
...
4) 0x00007ffff78a2a6b in g_assertion_message_expr ()
5) 0x00007ffff7defd5b in meta_window_update_for_monitors_changed () at ../src/core/window.c:3745
6) 0x00007ffff7899758 in g_slist_foreach () at ../glib/gslist.c:885
7) 0x00007ffff7dbe562 in meta_display_foreach_window () at ../src/core/display.c:3185
8) 0x00007ffff7dbe5fd in on_monitors_changed_internal () at ../src/core/display.c:3210
9) 0x00007ffff796f4ff in g_closure_invoke () at ../gobject/gclosure.c:830
10) 0x00007ffff7981316 in signal_emit_unlocked_R () at ../gobject/gsignal.c:3740
11) 0x00007ffff7987699 in g_signal_emit_valist () at ../gobject/gsignal.c:3495
12) 0x00007ffff7987bc2 in g_signal_emit () at ../gobject/gsignal.c:3551
13) 0x00007ffff7d89915 in meta_monitor_manager_notify_monitors_changed () at ../src/backends/meta-monitor-manager.c:3517
...
```
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2554>
-rw-r--r-- | src/tests/meson.build | 1 | ||||
-rw-r--r-- | src/tests/stacking/map-on-hotplug.metatest | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/tests/meson.build b/src/tests/meson.build index 14d817937..ae8c0ca60 100644 --- a/src/tests/meson.build +++ b/src/tests/meson.build @@ -354,6 +354,7 @@ stacking_tests = [ 'modals', 'map-fixed-size', 'client-resize-respect-constraints', + 'map-on-hotplug', ] foreach stacking_test: stacking_tests diff --git a/src/tests/stacking/map-on-hotplug.metatest b/src/tests/stacking/map-on-hotplug.metatest new file mode 100644 index 000000000..664ae21f1 --- /dev/null +++ b/src/tests/stacking/map-on-hotplug.metatest @@ -0,0 +1,20 @@ +# Test that monitor hotplugs with unmapped windows are handled + +new_client w wayland + +create w/1 csd +freeze w/1 +resize w/1 100 200 +show w/1 async + +resize_monitor primary 1024 768 + +wait + +thaw w/1 +wait +sync_shown w/1 +assert_stacking w/1 +assert_size w/1 100 200 + +destroy w/1 |