summaryrefslogtreecommitdiff
path: root/0001-gdm-session-Force-reuse-vt-mode-for-legacy-Xorg-mode.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 /0001-gdm-session-Force-reuse-vt-mode-for-legacy-Xorg-mode.patch
parentad790728cab5990635f0bf2f7b9bb71bab07b866 (diff)
automatic import of gdmopeneuler24.03_LTSopeneuler23.09
Diffstat (limited to '0001-gdm-session-Force-reuse-vt-mode-for-legacy-Xorg-mode.patch')
-rw-r--r--0001-gdm-session-Force-reuse-vt-mode-for-legacy-Xorg-mode.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/0001-gdm-session-Force-reuse-vt-mode-for-legacy-Xorg-mode.patch b/0001-gdm-session-Force-reuse-vt-mode-for-legacy-Xorg-mode.patch
new file mode 100644
index 0000000..4b71ddd
--- /dev/null
+++ b/0001-gdm-session-Force-reuse-vt-mode-for-legacy-Xorg-mode.patch
@@ -0,0 +1,88 @@
+From bcab8852cf7249a2220f6c737f7bb8a17b99249a Mon Sep 17 00:00:00 2001
+From: rpm-build <rpm-build>
+Date: Mon, 27 Nov 2023 15:29:09 -0500
+Subject: [PATCH 1/2] gdm-session: Force reuse vt mode for legacy Xorg mode
+
+In the legacy Xorg mode, the X session and user session are
+supposed to use the same VT.
+
+Unfortunately, right now GDM thinks they will use different
+VTs and that breaks PreferredDisplayServer=legacy-xorg.
+
+This commit fixes that.
+---
+ daemon/gdm-session.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
+index 9f68166..43e3ea6 100644
+--- a/daemon/gdm-session.c
++++ b/daemon/gdm-session.c
+@@ -3343,60 +3343,64 @@ gdm_session_bypasses_xsession (GdmSession *self)
+ if (error) {
+ bypasses_xsession = FALSE;
+ g_error_free (error);
+ goto out;
+ }
+ }
+
+ out:
+ if (bypasses_xsession) {
+ g_debug ("GdmSession: Session %s bypasses Xsession wrapper script", filename);
+ }
+ g_free (filename);
+ return bypasses_xsession;
+ }
+
+ GdmSessionDisplayMode
+ gdm_session_get_display_mode (GdmSession *self)
+ {
+ g_debug ("GdmSession: type %s, program? %s, seat %s",
+ self->session_type,
+ self->is_program_session? "yes" : "no",
+ self->display_seat_id);
+
+ /* Non-seat0 sessions share their X server with their login screen
+ * for now.
+ */
+ if (g_strcmp0 (self->display_seat_id, "seat0") != 0) {
+ return GDM_SESSION_DISPLAY_MODE_REUSE_VT;
+ }
+
++ if (self->display_x11_authority_file != NULL) {
++ return GDM_SESSION_DISPLAY_MODE_REUSE_VT;
++ }
++
+ #ifdef ENABLE_USER_DISPLAY_SERVER
+ /* All other cases (wayland login screen, X login screen,
+ * wayland user session, X user session) use the NEW_VT
+ * display mode. That display mode means that GDM allocates
+ * a new VT and jumps to it before starting the session. The
+ * session is expected to use logind to gain access to the
+ * display and input devices.
+ *
+ * GDM also has a LOGIND_MANAGED display mode which we can't
+ * use yet. The difference between it and NEW_VT, is with it,
+ * GDM doesn't do any VT handling at all, expecting the session
+ * and logind to do everything. The problem is, for wayland
+ * sessions it will cause flicker until * this bug is fixed:
+ *
+ * https://bugzilla.gnome.org/show_bug.cgi?id=745141
+ *
+ * Likewise, for X sessions it's problematic because
+ * 1) X doesn't call TakeControl before switching VTs
+ * 2) X doesn't support getting started "in the background"
+ * right now. It will die with an error if logind devices
+ * are paused when handed out.
+ */
+ return GDM_SESSION_DISPLAY_MODE_NEW_VT;
+ #else
+
+ #ifdef ENABLE_WAYLAND_SUPPORT
+ /* Wayland sessions are for now assumed to run in a
+ * mutter-launch-like environment, so we allocate
+ * a new VT for them. */
+ if (g_strcmp0 (self->session_type, "wayland") == 0) {
+--
+2.41.0
+