summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2014-03-17 21:31:27 -0400
committerRay Strode <rstrode@redhat.com>2014-03-17 21:36:06 -0400
commit9d3ef3b40264319fc83f9b5e5129e0ffc45e2271 (patch)
treefe30a03546c0acfb1f3ac39221bdca80d69c942b
parenta22e5252509332417380aa8169f6f58225cbe502 (diff)
downloadgdm-9d3ef3b40264319fc83f9b5e5129e0ffc45e2271.tar.gz
manager: update session-id when starting user session
In order for session unlocking to work properly, the session-id property of the display object needs to match the session running on the display. The display object's session-id property is bound to the slave's session-id property, so this commit makes sure the slave's session-id is updated to the user's session's id once the session is started. https://bugzilla.gnome.org/show_bug.cgi?id=726380
-rw-r--r--daemon/gdm-manager.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index 21a30c6a..40e0ffeb 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -928,6 +928,29 @@ on_session_opened (GdmSession *session,
}
static void
+on_session_started (GdmSession *session,
+ const char *service_name,
+ GPid pid,
+ GdmManager *manager)
+{
+ GdmDisplay *display;
+
+ g_debug ("GdmManager: session started %d", pid);
+
+ display = get_display_for_user_session (session);
+
+ if (display != NULL) {
+ GdmSlave *slave;
+ const char *session_id;
+
+ slave = gdm_display_get_slave (display);
+
+ session_id = gdm_session_get_session_id (session);
+ g_object_set (GDM_SLAVE (slave), "session-id", session_id, NULL);
+ }
+}
+
+static void
remove_user_session (GdmManager *manager,
GdmSession *session)
{
@@ -1454,6 +1477,10 @@ create_session_for_display (GdmManager *manager,
G_CALLBACK (on_session_opened),
manager);
g_signal_connect (session,
+ "session-started",
+ G_CALLBACK (on_session_started),
+ manager);
+ g_signal_connect (session,
"session-exited",
G_CALLBACK (on_user_session_exited),
manager);