Blame SOURCES/0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch

86f05a
From 73ccd50cabda8102b724d9bf647ac5a74963040d Mon Sep 17 00:00:00 2001
1f0c33
From: Ray Strode <rstrode@redhat.com>
1f0c33
Date: Mon, 11 Feb 2019 10:32:55 -0500
1f0c33
Subject: [PATCH 3/3] session: ensure login screen over XDMCP connects to its
1f0c33
 session
1f0c33
1f0c33
Right now GTK preferentially picks the wayland display over an
1f0c33
X11 display if it finds one.
1f0c33
1f0c33
That causes a problem for XDMCP sessions, since there may be a
1f0c33
wayland display running on the local console for the GDM user.
1f0c33
1f0c33
This commit addresses the issue by forcing the X11 backend if
1f0c33
the session is X11.
1f0c33
---
1f0c33
 daemon/gdm-session.c | 19 +++++++++++++++++++
1f0c33
 1 file changed, 19 insertions(+)
1f0c33
1f0c33
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
1f0c33
index f13b54af..9f68166e 100644
1f0c33
--- a/daemon/gdm-session.c
1f0c33
+++ b/daemon/gdm-session.c
1f0c33
@@ -2739,60 +2739,79 @@ set_up_session_environment (GdmSession *self)
1f0c33
 }
1f0c33
 
1f0c33
 static void
1f0c33
 send_display_mode (GdmSession *self,
1f0c33
                    GdmSessionConversation *conversation)
1f0c33
 {
1f0c33
         GdmSessionDisplayMode mode;
1f0c33
 
1f0c33
         mode = gdm_session_get_display_mode (self);
1f0c33
         gdm_dbus_worker_call_set_session_display_mode (conversation->worker_proxy,
1f0c33
                                                        gdm_session_display_mode_to_string (mode),
1f0c33
                                                        conversation->worker_cancellable,
1f0c33
                                                        NULL, NULL);
1f0c33
 }
1f0c33
 
1f0c33
 static void
1f0c33
 send_session_type (GdmSession *self,
1f0c33
                    GdmSessionConversation *conversation)
1f0c33
 {
1f0c33
         const char *session_type = "x11";
1f0c33
 
1f0c33
         if (self->session_type != NULL) {
1f0c33
                 session_type = self->session_type;
1f0c33
         }
1f0c33
 
1f0c33
         gdm_dbus_worker_call_set_environment_variable (conversation->worker_proxy,
1f0c33
                                                        "XDG_SESSION_TYPE",
1f0c33
                                                        session_type,
1f0c33
                                                        conversation->worker_cancellable,
1f0c33
                                                        NULL, NULL);
1f0c33
+
1f0c33
+        /* If the session type is x11, then set GDK_BACKEND to x11 as well.
1f0c33
+         * This is so gnome-session-check-accelerated from an XDMCP connection doesn't
1f0c33
+         * try to use the wayland display running on the local console for the gdm
1f0c33
+         * user login screen session.
1f0c33
+         *
1f0c33
+         * That's the only case where we let a user log in more than once, so it's
1f0c33
+         * the only situation that matters.
1f0c33
+         *
1f0c33
+         * We can drop this code if we ever switch the login screen to use systemd's
1f0c33
+         * DynamicUser feature.
1f0c33
+         */
1f0c33
+        if (g_strcmp0 (session_type, "x11") == 0) {
1f0c33
+                gdm_dbus_worker_call_set_environment_variable (conversation->worker_proxy,
1f0c33
+                                                               "GDK_BACKEND",
1f0c33
+                                                               "x11",
1f0c33
+                                                               conversation->worker_cancellable,
1f0c33
+                                                               NULL, NULL);
1f0c33
+        }
1f0c33
 }
1f0c33
 
1f0c33
 void
1f0c33
 gdm_session_open_session (GdmSession *self,
1f0c33
                           const char *service_name)
1f0c33
 {
1f0c33
         GdmSessionConversation *conversation;
1f0c33
 
1f0c33
         g_return_if_fail (GDM_IS_SESSION (self));
1f0c33
 
1f0c33
         conversation = find_conversation_by_name (self, service_name);
1f0c33
 
1f0c33
         if (conversation != NULL) {
1f0c33
                 send_display_mode (self, conversation);
1f0c33
                 send_session_type (self, conversation);
1f0c33
 
1f0c33
                 gdm_dbus_worker_call_open (conversation->worker_proxy,
1f0c33
                                            conversation->worker_cancellable,
1f0c33
                                            (GAsyncReadyCallback) on_opened, conversation);
1f0c33
         }
1f0c33
 }
1f0c33
 
1f0c33
 static void
1f0c33
 stop_all_other_conversations (GdmSession             *self,
1f0c33
                               GdmSessionConversation *conversation_to_keep,
1f0c33
                               gboolean                now)
1f0c33
 {
1f0c33
         GHashTableIter iter;
1f0c33
         gpointer key, value;
1f0c33
 
1f0c33
-- 
86f05a
2.37.3
1f0c33