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

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