[mutter] xwayland: Don't remove /tmp/.X11-unix/X0 when running tests
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] xwayland: Don't remove /tmp/.X11-unix/X0 when running tests
- Date: Sun, 19 Dec 2021 17:21:31 +0000 (UTC)
commit 0df12ebee62de06262da5b6d297d7ace44ad9938
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Dec 15 17:11:10 2021 +0100
xwayland: Don't remove /tmp/.X11-unix/X0 when running tests
When Xwayland was not initalized, we'd still clean things up. What this
accidentally meant was that the uninitialized display number 0 was
cleanud up, which very likely was main display of the host session.
What this meant in practice was that /tmp/.X11-unix/X0 was often
removed, causing every Flatpak X11 application to fail to start until
Xwayland was restarted nad the X0 socket file was restored.
Fix this in two ways: firstly only shutdown Xwayland if we ever started
it, i.e. if the X11 display policy was not 'disabled'. This should fix
the issue most of the times. Secondly only clean up the socket if it was
ever initialized. This should fix things if the socket creation failed,
as if it did, the name would be set.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2162>
src/wayland/meta-wayland.c | 7 ++++++-
src/wayland/meta-xwayland.c | 23 ++++++++++++++---------
2 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index dccf0da106..86435400e5 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -421,7 +421,12 @@ meta_wayland_log_func (const char *fmt,
void
meta_wayland_compositor_prepare_shutdown (MetaWaylandCompositor *compositor)
{
- meta_xwayland_shutdown (&compositor->xwayland_manager);
+ MetaX11DisplayPolicy x11_display_policy;
+
+ x11_display_policy =
+ meta_context_get_x11_display_policy (compositor->context);
+ if (x11_display_policy != META_X11_DISPLAY_POLICY_DISABLED)
+ meta_xwayland_shutdown (&compositor->xwayland_manager);
if (compositor->wayland_display)
wl_display_destroy_clients (compositor->wayland_display);
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index c6421a4305..77fb366ea1 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -1338,16 +1338,21 @@ meta_xwayland_shutdown (MetaXWaylandManager *manager)
meta_xwayland_terminate (manager);
- snprintf (path, sizeof path, "%s%d", X11_TMP_UNIX_PATH,
- manager->public_connection.display_index);
- unlink (path);
-
- snprintf (path, sizeof path, "%s%d", X11_TMP_UNIX_PATH,
- manager->private_connection.display_index);
- unlink (path);
+ if (manager->public_connection.name)
+ {
+ snprintf (path, sizeof path, "%s%d", X11_TMP_UNIX_PATH,
+ manager->public_connection.display_index);
+ unlink (path);
+ g_clear_pointer (&manager->public_connection.name, g_free);
+ }
- g_clear_pointer (&manager->public_connection.name, g_free);
- g_clear_pointer (&manager->private_connection.name, g_free);
+ if (manager->private_connection.name)
+ {
+ snprintf (path, sizeof path, "%s%d", X11_TMP_UNIX_PATH,
+ manager->private_connection.display_index);
+ unlink (path);
+ g_clear_pointer (&manager->private_connection.name, g_free);
+ }
meta_xwayland_connection_release (&manager->public_connection);
meta_xwayland_connection_release (&manager->private_connection);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]