gdm/SOURCES/0001-local-display-factory-pause-for-a-few-seconds-before.patch

93 lines
3.9 KiB
Diff
Raw Normal View History

2021-08-24 22:28:17 +00:00
From 5c52259331ce0b37dd1b2b092ff41f96b0e5ce64 Mon Sep 17 00:00:00 2001
2021-05-14 04:12:36 +00:00
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 29 Oct 2018 06:57:59 -0400
Subject: [PATCH] local-display-factory: pause for a few seconds before falling
back to X
logind currently gets confused if a session is started immediately as
one is shutting down.
Workaround this problem by adding an artificial delay when falling
back to X.
http://bugzilla.redhat.com/1643874
---
2021-08-24 22:28:17 +00:00
daemon/gdm-local-display-factory.c | 7 +++++++
1 file changed, 7 insertions(+)
2021-05-14 04:12:36 +00:00
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
2021-08-24 22:28:17 +00:00
index 0bb3851f1..297c3ac80 100644
2021-05-14 04:12:36 +00:00
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
2021-08-24 22:28:17 +00:00
@@ -586,60 +586,67 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory,
preferred_display_server = get_preferred_display_server (factory);
if (g_strcmp0 (preferred_display_server, "none") == 0) {
g_debug ("GdmLocalDisplayFactory: Preferred display server is none, so not creating display");
return;
}
ret = sd_seat_can_graphical (seat_id);
if (ret < 0) {
2021-05-14 04:12:36 +00:00
g_critical ("Failed to query CanGraphical information for seat %s", seat_id);
return;
}
if (ret == 0) {
g_debug ("GdmLocalDisplayFactory: System doesn't currently support graphics");
seat_supports_graphics = FALSE;
} else {
g_debug ("GdmLocalDisplayFactory: System supports graphics");
seat_supports_graphics = TRUE;
}
if (g_strcmp0 (seat_id, "seat0") == 0) {
is_seat0 = TRUE;
2021-08-24 22:28:17 +00:00
falling_back = factory->num_failures > 0;
session_type = gdm_local_display_factory_get_session_type (factory, falling_back);
g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s",
session_type, falling_back? " fallback" : "");
2021-05-21 10:11:54 +00:00
+
2021-08-24 22:28:17 +00:00
+ if (falling_back) {
+ /* workaround logind race for now
+ * bug 1643874
+ */
+ g_usleep (2 * G_USEC_PER_SEC);
+ }
2021-05-14 04:12:36 +00:00
} else {
is_seat0 = FALSE;
g_debug ("GdmLocalDisplayFactory: New displays on seat %s will use X11 fallback", seat_id);
/* Force legacy X11 for all auxiliary seats */
seat_supports_graphics = TRUE;
2021-08-24 22:28:17 +00:00
session_type = "x11";
2021-05-14 04:12:36 +00:00
}
/* For seat0, we have a fallback logic to still try starting it after
* SEAT0_GRAPHICS_CHECK_TIMEOUT seconds. i.e. we simply continue even if
* CanGraphical is unset.
* This is ugly, but it means we'll come up eventually in some
* scenarios where no master device is present.
* Note that we'll force an X11 fallback even though there might be
* cases where an wayland capable device is present and simply not marked as
* master-of-seat. In these cases, this should likely be fixed in the
* udev rules.
*
* At the moment, systemd always sets CanGraphical for non-seat0 seats.
* This is because non-seat0 seats are defined by having master-of-seat
* set. This means we can avoid the fallback check for non-seat0 seats,
* which simplifies the code.
*/
if (is_seat0) {
if (!seat_supports_graphics) {
if (!factory->seat0_graphics_check_timed_out) {
if (factory->seat0_graphics_check_timeout_id == 0) {
g_debug ("GdmLocalDisplayFactory: seat0 doesn't yet support graphics. Waiting %d seconds to try again.", SEAT0_GRAPHICS_CHECK_TIMEOUT);
factory->seat0_graphics_check_timeout_id = g_timeout_add_seconds (SEAT0_GRAPHICS_CHECK_TIMEOUT,
--
2021-08-24 22:28:17 +00:00
2.30.1
2021-05-14 04:12:36 +00:00