From 799c6dcf2fcd1c24715d7c2c1269b29560fc6254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 12 Apr 2021 14:59:09 +0200 Subject: [PATCH] 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: --- src/core/main.c | 8 ++++---- src/wayland/meta-xwayland.c | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/main.c b/src/core/main.c index 3c9f5e17e..6dabcfe73 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -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 diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index d83c8c770..274d9b3cc 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -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);