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

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