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

890c66
From f9662449f0f7dbb452ba11fe85a3c81b386f6dab Mon Sep 17 00:00:00 2001
890c66
From: Ray Strode <rstrode@redhat.com>
890c66
Date: Mon, 29 Oct 2018 06:57:59 -0400
890c66
Subject: [PATCH] local-display-factory: pause for a few seconds before falling
890c66
 back to X
890c66
890c66
logind currently gets confused if a session is started immediately as
890c66
one is shutting down.
890c66
890c66
Workaround this problem by adding an artificial delay when falling
890c66
back to X.
890c66
890c66
http://bugzilla.redhat.com/1643874
890c66
---
890c66
 daemon/gdm-local-display-factory.c | 5 +++++
890c66
 1 file changed, 5 insertions(+)
890c66
890c66
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
890c66
index 403921d32..ab7e12e91 100644
890c66
--- a/daemon/gdm-local-display-factory.c
890c66
+++ b/daemon/gdm-local-display-factory.c
890c66
@@ -283,60 +283,65 @@ on_display_status_changed (GdmDisplay             *display,
890c66
                 /* if this is a local display, do a full resync.  Only
890c66
                  * seats without displays will get created anyway.  This
890c66
                  * ensures we get a new login screen when the user logs out,
890c66
                  * if there isn't one.
890c66
                  */
890c66
                 if (is_local) {
890c66
                         /* reset num failures */
890c66
                         factory->priv->num_failures = 0;
890c66
 
890c66
                         gdm_local_display_factory_sync_seats (factory);
890c66
                 }
890c66
                 break;
890c66
         case GDM_DISPLAY_FAILED:
890c66
                 /* leave the display number in factory->priv->used_display_numbers
890c66
                    so that it doesn't get reused */
890c66
                 gdm_display_store_remove (store, display);
890c66
 
890c66
                 /* Create a new equivalent display if it was static */
890c66
                 if (is_local) {
890c66
 
890c66
                         factory->priv->num_failures++;
890c66
 
890c66
                         if (factory->priv->num_failures > MAX_DISPLAY_FAILURES) {
890c66
                                 /* oh shit */
890c66
                                 g_warning ("GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors");
890c66
                         } else {
890c66
 #ifdef ENABLE_WAYLAND_SUPPORT
890c66
                                 if (g_strcmp0 (session_type, "wayland") == 0) {
890c66
                                         g_free (session_type);
890c66
                                         session_type = NULL;
890c66
+
890c66
+                                        /* workaround logind race for now
890c66
+                                         * bug 1643874
890c66
+                                         */
890c66
+                                        sleep (2);
890c66
                                 }
890c66
 
890c66
 #endif
890c66
                                 create_display (factory, seat_id, session_type, is_initial);
890c66
                         }
890c66
                 }
890c66
                 break;
890c66
         case GDM_DISPLAY_UNMANAGED:
890c66
                 break;
890c66
         case GDM_DISPLAY_PREPARED:
890c66
                 break;
890c66
         case GDM_DISPLAY_MANAGED:
890c66
                 break;
890c66
         default:
890c66
                 g_assert_not_reached ();
890c66
                 break;
890c66
         }
890c66
 
890c66
         g_free (seat_id);
890c66
         g_free (session_type);
890c66
 }
890c66
 
890c66
 static gboolean
890c66
 lookup_by_seat_id (const char *id,
890c66
                    GdmDisplay *display,
890c66
                    gpointer    user_data)
890c66
 {
890c66
         const char *looking_for = user_data;
890c66
         char *current;
890c66
         gboolean res;
890c66
-- 
890c66
2.19.1
890c66