[mutter] main: Tear down Wayland support before MetaDisplay



commit 799c6dcf2fcd1c24715d7c2c1269b29560fc6254
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Mon Apr 12 14:59:09 2021 +0200

    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>

 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 3c9f5e17e8..6dabcfe73e 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 d83c8c770e..274d9b3ccc 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]