Commit e5a0e92f authored by Ray Strode's avatar Ray Strode
Browse files

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.
parent 7074f2a5
......@@ -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),
g_clear_pointer (&x11_display_name, g_free);
return TRUE;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment