summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2015-04-02 10:55:47 -0400
committerRay Strode <rstrode@redhat.com>2015-04-02 15:21:21 -0400
commite5a0e92f59e256edc6489f2234fbe54c25ba9743 (patch)
tree2f1cb73bde79b8fa07c90f8687a0b341d69aabba
parent7074f2a54124b54f8e85a19f6fecdb8232782a60 (diff)
downloadgdm-e5a0e92f59e256edc6489f2234fbe54c25ba9743.tar.gz
manager: find session at registration time
We try to look up the session at registration time to add wtmp records for it. We fail to actually find the session, though, because we're using the "embryonic-user-session" object data key, which is only non-NULL when the user session is still getting setup. This commit changes the registration code, to instead, fetch the session straight from the manager object. https://bugzilla.gnome.org/show_bug.cgi?id=747169
-rw-r--r--daemon/gdm-manager.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index db008c0d..4190e119 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -1069,6 +1069,30 @@ out:
return recorded;
}
+static GdmSession *
+get_user_session_for_display (GdmManager *self,
+ GdmDisplay *display)
+{
+ GList *node;
+
+ for (node = self->priv->user_sessions;
+ node != NULL;
+ node = node->next) {
+ GdmSession *session = node->data;
+ GdmDisplay *candidate_display;
+ GList *next_node = node->next;
+
+ candidate_display = get_display_for_user_session (session);
+
+ if (candidate_display == display)
+ return session;
+
+ node = next_node;
+ }
+
+ return NULL;
+}
+
static gboolean
gdm_manager_handle_register_display (GdmDBusManager *manager,
GDBusMethodInvocation *invocation,
@@ -1095,7 +1119,7 @@ gdm_manager_handle_register_display (GdmDBusManager *manager,
return TRUE;
}
- session = get_embryonic_user_session_for_display (display);
+ session = get_user_session_for_display (self, display);
if (session != NULL) {
GPid pid;
@@ -1112,6 +1136,7 @@ gdm_manager_handle_register_display (GdmDBusManager *manager,
gdm_dbus_manager_complete_register_display (GDM_DBUS_MANAGER (manager),
invocation);
+ g_clear_pointer (&x11_display_name, g_free);
return TRUE;
}