summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Lane <iainl@gnome.org>2018-07-04 16:49:19 +0100
committerIain Lane <iainl@gnome.org>2018-11-08 16:44:30 +0000
commit11ef1ae4c9ba9e23125b0e0989ff66f7bc872c3e (patch)
tree262831aaf554312aebe3319d7a6fd2245c7387d9
parentaa6932ca49670d08d0675160caa2c13e0b93f4a3 (diff)
downloadgdm-wip/laney/systemd-user-switch.tar.gz
Start gnome-session-systemd by defaultwip/laney/systemd-user-switch
This is a program which launches the specified unit and blocks until it is finished. It'll start gnome-login{,-wayland}.target for us.
-rw-r--r--daemon/gdm-launch-environment.c29
1 files 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);
}