[mutter/gnome-42] tests: Test hotplugs when having unmapped Wayland window



commit 389e46115622f17fa82e3419ddb94b04bb10bfd1
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Aug 3 23:10:00 2022 +0200

    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>

 src/tests/meson.build                      |  1 +
 src/tests/stacking/map-on-hotplug.metatest | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)
---
diff --git a/src/tests/meson.build b/src/tests/meson.build
index 14d8179372..ae8c0ca60b 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 0000000000..664ae21f1d
--- /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


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