main: Tear down Wayland support before MetaDisplay

MetaDisplay does a lot of things, and is a central part to anything
window management. To let Wayland units have an easier time tearing
down, make it so that the Wayland infrastructure is terminated before
MetaDisplay.

This also makes sure that X11 support is turned off, so that we don't
stumble upon Xwayland terminating due to the Wayland socket connection
being broken. Will mitigate that in a better way in a later commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1822>
This commit is contained in:
Jonas Ådahl 2021-04-12 14:59:09 +02:00 committed by Marge Bot
parent b71f52ff32
commit 799c6dcf2f
2 changed files with 6 additions and 4 deletions

View File

@ -367,15 +367,15 @@ meta_finalize (void)
if (backend)
meta_backend_prepare_shutdown (backend);
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
if (display)
meta_display_close (display,
META_CURRENT_TIME); /* I doubt correct timestamps matter here */
#ifdef HAVE_NATIVE_BACKEND
release_virtual_monitors ();
#endif

View File

@ -1289,6 +1289,8 @@ meta_xwayland_shutdown (MetaXWaylandManager *manager)
x_io_error_exit_noop, NULL);
#endif
meta_display_shutdown_x11 (meta_get_display ());
snprintf (path, sizeof path, "%s%d", X11_TMP_UNIX_PATH,
manager->public_connection.display_index);
unlink (path);