diff options
author | Ray Strode <rstrode@redhat.com> | 2015-04-02 10:55:47 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2015-04-02 15:21:21 -0400 |
commit | e5a0e92f59e256edc6489f2234fbe54c25ba9743 (patch) | |
tree | 2f1cb73bde79b8fa07c90f8687a0b341d69aabba /daemon | |
parent | 7074f2a54124b54f8e85a19f6fecdb8232782a60 (diff) | |
download | gdm-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
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gdm-manager.c | 27 |
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; } |