[gdm] manager: update session-id when starting user session



commit 9d3ef3b40264319fc83f9b5e5129e0ffc45e2271
Author: Ray Strode <rstrode redhat com>
Date:   Mon Mar 17 21:31:27 2014 -0400

    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

 daemon/gdm-manager.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index 21a30c6..40e0ffe 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);


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