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

f83012
From f9662449f0f7dbb452ba11fe85a3c81b386f6dab 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
f83012
index 403921d32..ab7e12e91 100644
f83012
--- a/daemon/gdm-local-display-factory.c
f83012
+++ b/daemon/gdm-local-display-factory.c
f83012
@@ -283,60 +283,65 @@ on_display_status_changed (GdmDisplay             *display,
f83012
                 /* if this is a local display, do a full resync.  Only
f83012
                  * seats without displays will get created anyway.  This
f83012
                  * ensures we get a new login screen when the user logs out,
f83012
                  * if there isn't one.
f83012
                  */
f83012
                 if (is_local) {
f83012
                         /* reset num failures */
f83012
                         factory->priv->num_failures = 0;
f83012
 
f83012
                         gdm_local_display_factory_sync_seats (factory);
f83012
                 }
f83012
                 break;
f83012
         case GDM_DISPLAY_FAILED:
f83012
                 /* leave the display number in factory->priv->used_display_numbers
f83012
                    so that it doesn't get reused */
f83012
                 gdm_display_store_remove (store, display);
f83012
 
f83012
                 /* Create a new equivalent display if it was static */
f83012
                 if (is_local) {
f83012
 
f83012
                         factory->priv->num_failures++;
f83012
 
f83012
                         if (factory->priv->num_failures > MAX_DISPLAY_FAILURES) {
f83012
                                 /* oh shit */
f83012
                                 g_warning ("GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors");
f83012
                         } else {
f83012
 #ifdef ENABLE_WAYLAND_SUPPORT
f83012
                                 if (g_strcmp0 (session_type, "wayland") == 0) {
f83012
                                         g_free (session_type);
f83012
                                         session_type = NULL;
f83012
+
f83012
+                                        /* workaround logind race for now
f83012
+                                         * bug 1643874
f83012
+                                         */
f83012
+                                        sleep (2);
f83012
                                 }
f83012
 
f83012
 #endif
f83012
                                 create_display (factory, seat_id, session_type, is_initial);
f83012
                         }
f83012
                 }
f83012
                 break;
f83012
         case GDM_DISPLAY_UNMANAGED:
f83012
                 break;
f83012
         case GDM_DISPLAY_PREPARED:
f83012
                 break;
f83012
         case GDM_DISPLAY_MANAGED:
f83012
                 break;
f83012
         default:
f83012
                 g_assert_not_reached ();
f83012
                 break;
f83012
         }
f83012
 
f83012
         g_free (seat_id);
f83012
         g_free (session_type);
f83012
 }
f83012
 
f83012
 static gboolean
f83012
 lookup_by_seat_id (const char *id,
f83012
                    GdmDisplay *display,
f83012
                    gpointer    user_data)
f83012
 {
f83012
         const char *looking_for = user_data;
f83012
         char *current;
f83012
         gboolean res;
f83012
-- 
f83012
2.19.1
f83012