Create display in "legacy-xorg" mode checking displays in tty

Resolves: https://redhat.atlassian.net/browse/RHEL-180822
This commit is contained in:
Joan Torres Lopez 2026-06-01 20:16:53 +02:00
parent 459d172db3
commit e0913cdea8
No known key found for this signature in database
6 changed files with 91 additions and 5 deletions

View File

@ -1,7 +1,7 @@
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/4] gdm-session: Force reuse vt mode for legacy Xorg mode
Subject: [PATCH 1/5] 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.

View File

@ -1,7 +1,7 @@
From 510566699c480226b189215c6222f7e72979baf8 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 22 May 2024 14:05:20 -0400
Subject: [PATCH 2/4] local-display-factory: Fix user switching with legacy
Subject: [PATCH 2/5] local-display-factory: Fix user switching with legacy
xorg
legacy-xorg sessions currently fail to completely user switch.

View File

@ -1,7 +1,7 @@
From de73b654cd1b726b905a9bf3238c7eaabfe465d5 Mon Sep 17 00:00:00 2001
From: Joan Torres <joantolo@redhat.com>
Date: Fri, 13 Jun 2025 13:05:07 +0200
Subject: [PATCH 3/4] local-display-factory: Ensure displays are properly
Subject: [PATCH 3/5] local-display-factory: Ensure displays are properly
handled on status change
1. There are some cases where a display will change its status from any

View File

@ -1,7 +1,7 @@
From 8bcb9f43c203ab4818381cd707128eac74ab958d Mon Sep 17 00:00:00 2001
From: Joan Torres <joantolo@redhat.com>
Date: Fri, 13 Jun 2025 12:56:41 +0200
Subject: [PATCH 4/4] local-display-factory: Return a session type on
Subject: [PATCH 4/5] local-display-factory: Return a session type on
legacy-xorg
On legacy-xorg, there's graphic support through Xorg.

View File

@ -0,0 +1,81 @@
From ce2a019ad18e4e11eb45218fa5a86055fa8a1533 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Mon, 1 Jun 2026 20:04:50 +0200
Subject: [PATCH 5/5] local-display-factory: Consider tty when ensuring display on seat
In "leagcy-xorg" mode there can be cases where ensure_display() is called
because some new device was inserted or seat properties changed... in
those cases we were creating a new display when active_vt != GDM_INITIAL_VT while
there was already a display on that vt.
To fix that, check if there's already a display in the active_vt.
---
daemon/gdm-local-display-factory.c | 35 +++++++++++++++---------------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index 3a35018..393437c 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -110,6 +110,10 @@ static gboolean lookup_by_session_id (const char *id,
GdmDisplay *display,
gpointer user_data);
+static gboolean lookup_by_tty (const char *id,
+ GdmDisplay *display,
+ gpointer user_data);
+
G_DEFINE_TYPE (GdmLocalDisplayFactory, gdm_local_display_factory, GDM_TYPE_DISPLAY_FACTORY)
GQuark
@@ -674,18 +678,14 @@ lookup_prepared_display_by_seat_id (const char *id,
}
static gboolean
-lookup_managed_display_by_seat_id (const char *id,
- GdmDisplay *display,
- gpointer user_data)
+lookup_managed_display_by_tty (const char *id,
+ GdmDisplay *display,
+ gpointer user_data)
{
- int status;
-
- status = gdm_display_get_status (display);
-
- if (status != GDM_DISPLAY_MANAGED)
+ if (gdm_display_get_status (display) != GDM_DISPLAY_MANAGED)
return FALSE;
- return lookup_by_seat_id (id, display, user_data);
+ return lookup_by_tty (id, display, user_data);
}
#ifdef HAVE_UDEV
@@ -919,15 +919,14 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory,
if (is_seat0) {
if (g_strcmp0 (preferred_display_server, "legacy-xorg") == 0) {
- GdmDisplay *initial_display = NULL;
-
- display = gdm_display_store_find (store, lookup_managed_display_by_seat_id, (gpointer) seat_id);
- initial_display = gdm_display_store_find (store, lookup_initial_display, (gpointer) NULL);
-
- if (initial_display == NULL || factory->active_vt != GDM_INITIAL_VT)
- display = NULL;
-
- is_initial = initial_display == NULL;
+ display = gdm_display_store_find (store, lookup_initial_display, (gpointer) NULL);
+ if (display == NULL) {
+ is_initial = TRUE;
+ } else if (factory->active_vt != 0 && factory->active_vt != GDM_INITIAL_VT) {
+ g_autofree char *tty = g_strdup_printf ("tty%u", factory->active_vt);
+ display = gdm_display_store_find (store, lookup_managed_display_by_tty, (gpointer) tty);
+ is_initial = FALSE;
+ }
} else {
display = gdm_display_store_find (store, lookup_prepared_display_by_seat_id, (gpointer) seat_id);
is_initial = TRUE;
--
2.54.0

View File

@ -11,7 +11,7 @@
Name: gdm
Epoch: 1
Version: 40.1
Release: 46%{?dist}
Release: 47%{?dist}
Summary: The GNOME Display Manager
License: GPLv2+
@ -57,6 +57,7 @@ Patch100001: 0001-gdm-session-Force-reuse-vt-mode-for-legacy-Xorg-mode.patch
Patch100002: 0002-local-display-factory-Fix-user-switching-with-legacy.patch
Patch100003: 0003-local-display-factory-Ensure-displays-are-properly-h.patch
Patch100004: 0004-local-display-factory-Return-a-session-type-on-legac.patch
Patch100005: 0005-local-display-factory-Consider-tty-when-ensuring-dis.patch
Patch110001: 0001-display-Add-new-FAILING-state.patch
Patch110002: 0002-manager-Quit-plymouth-at-first-sign-of-failure.patch
@ -391,6 +392,10 @@ dconf update || :
%{_libdir}/pkgconfig/gdm-pam-extensions.pc
%changelog
* Mon Jun 1 2026 Joan Torres Lopez <joantolo@redhat.com> - 40.1-47
- Create display in "legacy-xorg" mode checking displays in tty
Resolves: https://redhat.atlassian.net/browse/RHEL-180822
* Thu May 28 2026 Joan Torres Lopez <joantolo@redhat.com> - 40.1-46
- Fix last change when setting xsession program
Related: https://redhat.atlassian.net/browse/RHEL-178686