[gdm] session: update session type when session is read



commit d7eda0dde0abaade523b1485e1803cee29d1c824
Author: Ray Strode <rstrode redhat com>
Date:   Thu Apr 27 10:20:09 2017 -0400

    session: update session type when session is read
    
    We currently update the session type (to either wayland or
    x11) when we first start the PAM conversation and later when
    the username is set (if the user is not set at the same time as
    the PAM conversation).
    
    There's a race that means the session won't necessarly have been
    read from accountsservice at these points.
    
    This commit changes the code to instead update the session type
    in result to the session actually getting read.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781825

 daemon/gdm-session.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 08d61de..ff3a1ac 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -938,11 +938,8 @@ worker_on_saved_session_name_read (GdmDBusWorker          *worker,
                 g_debug ("GdmSession: not using invalid .dmrc session: %s", session_name);
                 g_free (self->priv->saved_session);
                 self->priv->saved_session = NULL;
-                return;
-        }
-
-        if (strcmp (session_name,
-                    get_default_session_name (self)) != 0) {
+        } else if (strcmp (session_name,
+                   get_default_session_name (self)) != 0) {
                 g_free (self->priv->saved_session);
                 self->priv->saved_session = g_strdup (session_name);
 
@@ -951,6 +948,9 @@ worker_on_saved_session_name_read (GdmDBusWorker          *worker,
                                                                             session_name);
                 }
         }
+
+        update_session_type (self);
+
 }
 
 static GdmSessionConversation *
@@ -2295,8 +2295,9 @@ gdm_session_setup (GdmSession *self,
 
         g_return_if_fail (GDM_IS_SESSION (self));
 
+        update_session_type (self);
+
         send_setup (self, service_name);
-        gdm_session_defaults_changed (self);
 }
 
 
@@ -2309,11 +2310,12 @@ gdm_session_setup_for_user (GdmSession *self,
         g_return_if_fail (GDM_IS_SESSION (self));
         g_return_if_fail (username != NULL);
 
+        update_session_type (self);
+
         gdm_session_select_user (self, username);
 
         self->priv->is_program_session = FALSE;
         send_setup_for_user (self, service_name);
-        gdm_session_defaults_changed (self);
 }
 
 void


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