From f6b4665b02fb295b0ca034766eb9075da5f17b8e Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 13 Jan 2021 18:28:46 +0100 Subject: [PATCH] xwayland: Check for X11 unix directory only once The function choose_xdisplay() calls open_display_sockets() which calls ensure_x11_unix_dir(). We don't need to do that from within the loop though, as the directory /tmp/.X11-unix is the same regardless of the display number. Move the call to ensure_x11_unix_dir() from open_display_sockets() to choose_xdisplay() prior to enter the display loop. Part-of: --- src/wayland/meta-xwayland.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 56a50b134..7dc7077f6 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -649,9 +649,6 @@ open_display_sockets (MetaXWaylandManager *manager, { int abstract_fd, unix_fd; - if (!ensure_x11_unix_dir (error)) - return FALSE; - abstract_fd = bind_to_abstract_socket (display_index, fatal, error); if (abstract_fd < 0) return FALSE; @@ -684,6 +681,9 @@ choose_xdisplay (MetaXWaylandManager *manager, else if (g_getenv ("RUNNING_UNDER_GDM")) display = 1024; + if (!ensure_x11_unix_dir (error)) + return FALSE; + do { g_autoptr (GError) local_error = NULL;