From a607500107b595459a54a045b20c1a5828b66d92 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 22 Mar 2012 14:54:43 +0000 Subject: slave: don't jump to text vts commit fb6a3cf203c7fda3a9a33d3e3b4e7a7b868cb43e fixed user-switching so that we always migrate to a pre-existing session if it's runninng. Unfortunately, we didn't filter out tty sessions. This commit ensures GDM only jumps to graphical sessions. https://bugzilla.gnome.org/show_bug.cgi?id=672630 --- diff --git a/daemon/gdm-slave.c b/daemon/gdm-slave.c index f1f4c47..6e1b45c 100644 --- a/daemon/gdm-slave.c +++ b/daemon/gdm-slave.c @@ -1344,9 +1344,28 @@ gdm_slave_get_primary_session_id_for_user_from_systemd (GdmSlave *slave, } for (i = 0; sessions[i] != NULL; i++) { + char *type; gboolean is_active; + gboolean is_x11; uid_t other; + res = sd_session_get_type (sessions[i], &type); + + if (res < 0) { + g_warning ("GdmSlave: could not fetch type of session '%s': %s", + sessions[i], strerror (-res)); + continue; + } + + is_x11 = g_strcmp0 (type, "x11") == 0; + g_free (type); + + /* Only migrate to graphical sessions + */ + if (!is_x11) { + continue; + } + /* Always give preference to non-active sessions, * so we migrate when we can and don't when we can't */ -- cgit v0.9.0.2