mirror of
https://github.com/brl/mutter.git
synced 2025-08-10 02:14:42 +00:00
wayland: Make init and shutdown symmetric
We first initialized the Wayland infrastructure, then the display, but on shutdown, we first teared down the Wayland infrastructure, then the display. Make things a bit more symmetric and tear down the display before Wayland. This however means we need to tear down some things Wayland a bit earlier than the rest. For now this is a separate function, but eventually, it can be replaced with a signal shared by the backend's 'prepare-shutdown' signal. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1863>
This commit is contained in:
@@ -308,19 +308,27 @@ meta_finalize (void)
|
||||
{
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
#ifdef HAVE_WAYLAND
|
||||
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
|
||||
#endif
|
||||
|
||||
if (backend)
|
||||
meta_backend_prepare_shutdown (backend);
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
if (meta_is_wayland_compositor ())
|
||||
meta_wayland_finalize ();
|
||||
if (compositor)
|
||||
meta_wayland_compositor_prepare_shutdown (compositor);
|
||||
#endif
|
||||
|
||||
if (display)
|
||||
meta_display_close (display,
|
||||
META_CURRENT_TIME); /* I doubt correct timestamps matter here */
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
if (meta_is_wayland_compositor ())
|
||||
meta_wayland_finalize ();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
release_virtual_monitors ();
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user