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

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