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