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