display: Unmanage windows before compositor

Prior to 'compositor: Destroy actors when unmanaging', window actors
were destroyed when the compositor object was destroyed, long after the
windows were unmanaged, however, when this instead changed to happen
when unmanaging, with the original goal to avoid having these actors try
to interact with the disposed MetaCompositor instance, it caused an
issue where window actors would be indirectly destroyed as a side effect
of their parents being destroyed, which caused some fallout in the logic
handling window-close animation tracking, which relies on
meta_window_actor_queue_destroy() being called before a window actor is
actually destroyed.

Fix this by unmanaging windows before unmanaging the compositor.

From an X11 point of view, this should be harmless, since all it really
do is call XCompositeUnredirectSubwindows().

For the native backend and the common behavior, all unmanaging the
compositor instance does is destroy clutter actors, so doing so after
window actors were already cleaned up should not be a problem, as this
was the case before too.

Fixes: 35ac3a096d
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5330
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2403>
This commit is contained in:
Jonas Ådahl 2022-05-06 17:49:50 +02:00 committed by Marge Bot
parent 570b94fc43
commit 8ec8a26717

View File

@ -1132,9 +1132,8 @@ meta_display_close (MetaDisplay *display,
g_signal_emit (display, display_signals[CLOSING], 0); g_signal_emit (display, display_signals[CLOSING], 0);
meta_compositor_unmanage (display->compositor);
meta_display_unmanage_windows (display, timestamp); meta_display_unmanage_windows (display, timestamp);
meta_compositor_unmanage (display->compositor);
meta_prefs_remove_listener (prefs_changed_callback, display); meta_prefs_remove_listener (prefs_changed_callback, display);