From 11ef1ae4c9ba9e23125b0e0989ff66f7bc872c3e Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Wed, 4 Jul 2018 16:49:19 +0100 Subject: 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); } -- cgit v1.2.1