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

93 lines
3.9 KiB
Diff
Raw Normal View History

2021-09-03 04:19:30 +00:00
From 903dd62114d24a90fe55a7cf42ea07233fe71879 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
2021-09-03 04:19:30 +00:00
Subject: [PATCH] local-display-factory: pause for a few seconds before
falling back to X
2021-05-14 04:12:36 +00:00
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-09-03 04:19:30 +00:00
index eba38671..948c5d98 100644
2021-05-14 04:12:36 +00:00
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
2021-09-03 04:19:30 +00:00
@@ -653,60 +653,67 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory,
2021-08-24 22:28:17 +00:00
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;
2021-09-03 04:19:30 +00:00
session_types = gdm_local_display_factory_get_session_types (factory, falling_back);
2021-08-24 22:28:17 +00:00
g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s",
2021-09-03 04:19:30 +00:00
session_types[0], falling_back? " fallback" : "");
2021-05-21 10:11:54 +00:00
+
2021-09-03 04:19:30 +00:00
+ if (falling_back) {
2021-08-24 22:28:17 +00:00
+ /* workaround logind race for now
+ * bug 1643874
+ */
+ g_usleep (2 * G_USEC_PER_SEC);
2021-09-03 04:19:30 +00:00
+ }
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-09-03 04:19:30 +00:00
session_types = g_strdupv ((char **) legacy_session_types);
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-09-03 04:19:30 +00:00
2.27.0
2021-05-14 04:12:36 +00:00