[gdm/wip/laney/systemd-user-switch: 4/4] Start gnome-session-systemd by default



commit bb62e354f3a9c2d79c9a15d918e0b5af476731de
Author: Iain Lane <iainl gnome org>
Date:   Wed Jul 4 16:49:19 2018 +0100

    Start gnome-session-systemd by default
    
    This is a program which launches the specified unit and blocks until it
    is finished. It'll start gnome-login{,-wayland}.target for us.

 daemon/gdm-launch-environment.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gdm-launch-environment.c b/daemon/gdm-launch-environment.c
index 097366ee..56ab864c 100644
--- a/daemon/gdm-launch-environment.c
+++ b/daemon/gdm-launch-environment.c
@@ -948,13 +948,32 @@ create_gnome_session_environment (const char *session_id,
         gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
 
         args = g_ptr_array_new ();
-        g_ptr_array_add (args, "gnome-session");
 
-        if (debug) {
-                g_ptr_array_add (args, "--debug");
-        }
+        if (session_id == NULL) {
+                /* XXX: we only run gnome-session-systemd for the default
+                 * sessions at the minute - we should support passing a pair of
+                 * unit names into this function */
+                g_ptr_array_add (args, "gnome-session-systemd");
+
+                if (debug) {
+                        g_ptr_array_add (args, "--debug");
+                }
+
+                /* the default is to start gnome-login{-wayland,}.target. If
+                 * systemd isn't running, gnome-session-systemd will fall back.
+                 * */
+                if (g_strcmp0 (session_type, "wayland") == 0) {
+                        g_ptr_array_add (args, "gnome-login-wayland.target");
+                } else {
+                        g_ptr_array_add (args, "gnome-login.target");
+                }
+        } else {
+                g_ptr_array_add (args, "gnome-session");
+
+                if (debug) {
+                        g_ptr_array_add (args, "--debug");
+                }
 
-        if (session_id != NULL) {
                 g_ptr_array_add (args, " --session");
                 g_ptr_array_add (args, (char *) session_id);
         }


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