monitor-manager: Reload monitor manager in idle callback

When a virtual stream is destroyed, its respective virtual monitor is
destroyed too. When the virtual monitor is destroyed, mutter reloads
the monitor manager.
However, at this point, the virtual stream is not completely destroyed
yet. The viewport of the virtual monitor still exists at this point and
when the monitor manager reloads, it will try to fetch the logical
monitor of the now destroyed virtual monitor, which will fail and thus
gnome-shell will run into a segfault.

Fix this situation by reloading the monitor manager in an idle callback.
When the monitor manager reloads, the virtual monitor is completely
gone, since the viewport of the virtual monitor is destroyed after the
virtual monitor itself.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2864
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3307>
This commit is contained in:
Pascal Nowack
2023-09-29 14:31:41 +02:00
parent e70fa342a9
commit d2122a02a3
3 changed files with 24 additions and 3 deletions

View File

@ -146,6 +146,7 @@ meta_test_cursor_hotplug (void)
meta_wayland_test_client_finish (test_client);
g_clear_object (&virtual_monitor);
meta_wait_for_monitors_changed (test_context);
meta_wait_for_paint (test_context);
}
@ -207,6 +208,7 @@ meta_test_hotplug_multi_view_invalidation (void)
g_signal_handler_disconnect (cursor_sprite, texture_changed_handler_id);
g_clear_object (&virtual_monitor);
meta_wait_for_monitors_changed (test_context);
meta_wait_for_paint (test_context);
}