Blame SOURCES/0001-daemon-Infer-session-type-from-desktop-file-if-user-.patch

6b1540
From ff689b18fd0a5fd03e5941723cb2adff3b7e4b24 Mon Sep 17 00:00:00 2001
6b1540
From: Ray Strode <rstrode@redhat.com>
6b1540
Date: Wed, 29 Sep 2021 11:03:41 -0400
6b1540
Subject: [PATCH] daemon: Infer session type from desktop file if user has no
6b1540
 saved session type
6b1540
6b1540
The accountsservice user cache file can specify a session type
6b1540
associated with the saved session.  This is optional though. If one
6b1540
isn't specified GDM needs to figure out the session type based on the
6b1540
list of preferred session types for the system and the session file
6b1540
itself.
6b1540
6b1540
It was failing to do the latter, though.  This commit fixes that.
6b1540
---
6b1540
 daemon/gdm-session.c | 2 ++
6b1540
 1 file changed, 2 insertions(+)
6b1540
6b1540
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
6b1540
index 29459346..72afe7b2 100644
6b1540
--- a/daemon/gdm-session.c
6b1540
+++ b/daemon/gdm-session.c
6b1540
@@ -988,60 +988,62 @@ worker_on_saved_language_name_read (GdmDBusWorker          *worker,
6b1540
                 }
6b1540
         }
6b1540
 }
6b1540
 
6b1540
 static void
6b1540
 worker_on_saved_session_name_read (GdmDBusWorker          *worker,
6b1540
                                    const char             *session_name,
6b1540
                                    GdmSessionConversation *conversation)
6b1540
 {
6b1540
         GdmSession *self = conversation->session;
6b1540
 
6b1540
         if (! get_session_command_for_name (self, session_name, NULL)) {
6b1540
                 /* ignore sessions that don't exist */
6b1540
                 g_debug ("GdmSession: not using invalid .dmrc session: %s", session_name);
6b1540
                 g_free (self->saved_session);
6b1540
                 self->saved_session = NULL;
6b1540
                 update_session_type (self);
6b1540
         } else {
6b1540
                 if (strcmp (session_name,
6b1540
                             get_default_session_name (self)) != 0) {
6b1540
                         g_free (self->saved_session);
6b1540
                         self->saved_session = g_strdup (session_name);
6b1540
 
6b1540
                         if (self->greeter_interface != NULL) {
6b1540
                                 gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface,
6b1540
                                                                                     session_name);
6b1540
                         }
6b1540
                 }
6b1540
                 if (self->saved_session_type != NULL)
6b1540
                         set_session_type (self, self->saved_session_type);
6b1540
+                else
6b1540
+                        update_session_type (self);
6b1540
         }
6b1540
 
6b1540
 }
6b1540
 
6b1540
 static GdmSessionConversation *
6b1540
 find_conversation_by_pid (GdmSession *self,
6b1540
                           GPid        pid)
6b1540
 {
6b1540
         GHashTableIter iter;
6b1540
         gpointer key, value;
6b1540
 
6b1540
         g_hash_table_iter_init (&iter, self->conversations);
6b1540
         while (g_hash_table_iter_next (&iter, &key, &value)) {
6b1540
                 GdmSessionConversation *conversation;
6b1540
 
6b1540
                 conversation = (GdmSessionConversation *) value;
6b1540
 
6b1540
                 if (conversation->worker_pid == pid) {
6b1540
                         return conversation;
6b1540
                 }
6b1540
         }
6b1540
 
6b1540
         return NULL;
6b1540
 }
6b1540
 
6b1540
 static gboolean
6b1540
 allow_worker_function (GDBusAuthObserver *observer,
6b1540
                        GIOStream         *stream,
6b1540
                        GCredentials      *credentials,
6b1540
                        GdmSession        *self)
6b1540
-- 
6b1540
2.33.1
6b1540