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

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