[mutter/benzea/xwayland-non-systemd-startup] main: Force Xwayland startup if not on systemd




commit 18388a18309e254905f4f0ce5886c233770a7683
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Mar 11 18:52:48 2021 +0100

    main: Force Xwayland startup if not on systemd
    
    In non-systemd managed session we are unable to start services on
    demand. Instead, gnome-session will start everything at login time,
    including any X11 related service (i.e. gsd-xsettings).
    
    However, in order to start gsd-xsettings, Xwayland needs to be started
    already. Otherwise it will connect to GNOME_SETUP_DISPLAY and login will
    hang at that point.
    
    Fix this by detecting whether mutter is running in a systemd unit. If it
    is, we assume that we are systemd managed and the machinery to start the
    services works fine. If not, we assume that the session management may
    unconditionally try to start X11 related services and Xwayland must be
    started in order to not block this.

 src/core/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/core/main.c b/src/core/main.c
index 4bcfd7a5de..a9e959b057 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -797,11 +797,16 @@ meta_get_x11_display_policy (void)
 #ifdef HAVE_WAYLAND
   if (meta_is_wayland_compositor ())
     {
+      g_autofree char *unit = NULL;
+
       if (opt_no_x11)
         return META_DISPLAY_POLICY_DISABLED;
 
 #ifdef HAVE_XWAYLAND_INITFD
-      return META_DISPLAY_POLICY_ON_DEMAND;
+      if (sd_pid_get_user_unit (0, &unit) < 0)
+        return META_DISPLAY_POLICY_MANDATORY;
+      else
+        return META_DISPLAY_POLICY_ON_DEMAND;
 #endif
     }
 #endif


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