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

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