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

ffa191
From 89ec6e57e452c04ffc43ae224052c7ddeea66676 Mon Sep 17 00:00:00 2001
f83012
From: Ray Strode <rstrode@redhat.com>
f83012
Date: Mon, 29 Oct 2018 06:57:59 -0400
f83012
Subject: [PATCH] local-display-factory: pause for a few seconds before falling
f83012
 back to X
f83012
f83012
logind currently gets confused if a session is started immediately as
f83012
one is shutting down.
f83012
f83012
Workaround this problem by adding an artificial delay when falling
f83012
back to X.
f83012
f83012
http://bugzilla.redhat.com/1643874
f83012
---
f83012
 daemon/gdm-local-display-factory.c | 5 +++++
f83012
 1 file changed, 5 insertions(+)
f83012
f83012
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
ffa191
index 8a4ef06cd..8554a0442 100644
f83012
--- a/daemon/gdm-local-display-factory.c
f83012
+++ b/daemon/gdm-local-display-factory.c
ffa191
@@ -488,60 +488,65 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory,
ffa191
                 g_critical ("Failed to query CanGraphical information for seat %s", seat_id);
ffa191
                 return;
ffa191
         }
f83012
 
ffa191
         if (ret == 0) {
ffa191
                 g_debug ("GdmLocalDisplayFactory: System doesn't currently support graphics");
ffa191
                 seat_supports_graphics = FALSE;
ffa191
         } else {
ffa191
                 g_debug ("GdmLocalDisplayFactory: System supports graphics");
ffa191
                 seat_supports_graphics = TRUE;
ffa191
         }
f83012
 
ffa191
         if (g_strcmp0 (seat_id, "seat0") == 0) {
ffa191
                 is_seat0 = TRUE;
f83012
 
ffa191
                 /* If we've failed, or are explicitly told to, fall back to legacy X11 support
ffa191
                  */
ffa191
                 if (factory->num_failures > 0 || !gdm_local_display_factory_use_wayland ()) {
ffa191
                         session_type = NULL;
ffa191
                         g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use X11 fallback");
36f0b7
+
36f0b7
+                        /* workaround logind race for now
36f0b7
+                         * bug 1643874
36f0b7
+                         */
36f0b7
+                        g_usleep (2 * G_USEC_PER_SEC);
ffa191
                 } else {
ffa191
                         g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use wayland");
ffa191
                 }
ffa191
         } else {
ffa191
                 is_seat0 = FALSE;
f83012
 
ffa191
                 g_debug ("GdmLocalDisplayFactory: New displays on seat %s will use X11 fallback", seat_id);
ffa191
                 /* Force legacy X11 for all auxiliary seats */
ffa191
                 seat_supports_graphics = TRUE;
ffa191
                 session_type = NULL;
f83012
         }
f83012
 
ffa191
         /* For seat0, we have a fallback logic to still try starting it after
ffa191
          * SEAT0_GRAPHICS_CHECK_TIMEOUT seconds. i.e. we simply continue even if
ffa191
          * CanGraphical is unset.
ffa191
          * This is ugly, but it means we'll come up eventually in some
ffa191
          * scenarios where no master device is present.
ffa191
          * Note that we'll force an X11 fallback even though there might be
ffa191
          * cases where an wayland capable device is present and simply not marked as
ffa191
          * master-of-seat. In these cases, this should likely be fixed in the
ffa191
          * udev rules.
ffa191
          *
ffa191
          * At the moment, systemd always sets CanGraphical for non-seat0 seats.
ffa191
          * This is because non-seat0 seats are defined by having master-of-seat
ffa191
          * set. This means we can avoid the fallback check for non-seat0 seats,
ffa191
          * which simplifies the code.
ffa191
          */
ffa191
         if (is_seat0) {
ffa191
                 if (!seat_supports_graphics) {
ffa191
                         if (!factory->seat0_graphics_check_timed_out) {
ffa191
                                 if (factory->seat0_graphics_check_timeout_id == 0) {
ffa191
                                         g_debug ("GdmLocalDisplayFactory: seat0 doesn't yet support graphics.  Waiting %d seconds to try again.", SEAT0_GRAPHICS_CHECK_TIMEOUT);
ffa191
                                         factory->seat0_graphics_check_timeout_id = g_timeout_add_seconds (SEAT0_GRAPHICS_CHECK_TIMEOUT,
ffa191
                                                                                                           on_seat0_graphics_check_timeout,
ffa191
                                                                                                           factory);
f83012
 
ffa191
                                 } else {
ffa191
                                         /* It is not yet time to force X11 fallback. */
ffa191
                                         g_debug ("GdmLocalDisplayFactory: seat0 display requested when there is no graphics support before graphics check timeout.");
ffa191
                                 }
f83012
-- 
ffa191
2.31.1
f83012