Blob Blame History Raw
From 05e49542a9de81731fce68614babe22d437e8fff Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 1 Oct 2018 11:05:57 -0400
Subject: [PATCH 33/51] manager: correct display confusion

commit c5c5bf1f reworked autologin and broke it.

This commit addresses the breakage by accessing
the proper display variable.

Closes https://gitlab.gnome.org/GNOME/gdm/issues/426
---
 daemon/gdm-manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index 228cec6ff..4c81dac7f 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -1711,61 +1711,61 @@ on_start_user_session (StartUserSessionOperation *operation)
                 if (doing_initial_setup) {
                         g_debug ("GdmManager: closing down initial setup display");
                         gdm_display_stop_greeter_session (display);
                         gdm_display_unmanage (display);
                         gdm_display_finish (display);
                 } else {
                         g_debug ("GdmManager: session has its display server, reusing our server for another login screen");
                 }
 
                 /* The user session is going to follow the session worker
                  * into the new display. Untie it from this display and
                  * create a new session for a future user login. */
                 allowed_uid = gdm_session_get_allowed_user (operation->session);
                 g_object_set_data (G_OBJECT (display), "gdm-user-session", NULL);
                 g_object_set_data (G_OBJECT (operation->session), "gdm-display", NULL);
                 create_user_session_for_display (operation->manager, display, allowed_uid);
 
                 /* Give the user session a new display object for bookkeeping purposes */
                 create_display_for_user_session (operation->manager,
                                                  operation->session,
                                                  session_id);
 
                 if ((g_strcmp0 (operation->service_name, "gdm-autologin") == 0) &&
                     !gdm_session_client_is_connected (operation->session)) {
                         /* remove the unused prepared greeter display since we're not going
                          * to have a greeter */
                         gdm_display_store_remove (self->priv->display_store, display);
                         g_object_unref (display);
 
                         self->priv->automatic_login_display = g_object_get_data (G_OBJECT (operation->session), "gdm-display");
-                        g_object_add_weak_pointer (G_OBJECT (display), (gpointer *) &self->priv->automatic_login_display);
+                        g_object_add_weak_pointer (G_OBJECT (self->priv->automatic_login_display), (gpointer *) &self->priv->automatic_login_display);
                 }
         }
 
         start_user_session (operation->manager, operation);
 
  out:
         return G_SOURCE_REMOVE;
 }
 
 static void
 queue_start_user_session (GdmManager *manager,
                           GdmSession *session,
                           const char *service_name)
 {
         StartUserSessionOperation *operation;
 
         operation = g_slice_new0 (StartUserSessionOperation);
         operation->manager = manager;
         operation->session = g_object_ref (session);
         operation->service_name = g_strdup (service_name);
 
         operation->idle_id = g_idle_add ((GSourceFunc) on_start_user_session, operation);
         g_object_set_data (G_OBJECT (session), "start-user-session-operation", operation);
 }
 
 static void
 start_user_session_if_ready (GdmManager *manager,
                              GdmSession *session,
                              const char *service_name)
 {
-- 
2.27.0