Blame SOURCES/0031-local-display-factory-don-t-autoreap-initial-setup.patch

a1b388
From 59b3b809400dfac25410cf99dbc15cb5f66f85a3 Mon Sep 17 00:00:00 2001
a1b388
From: Ray Strode <rstrode@redhat.com>
a1b388
Date: Tue, 25 Sep 2018 14:52:15 -0400
a1b388
Subject: [PATCH 31/51] local-display-factory: don't autoreap initial-setup
a1b388
a1b388
We automatically kill the login screen when switching VTs away
a1b388
from it, but we should never kill the initial-setup screen in
a1b388
that situation.
a1b388
a1b388
This commit adds a check to prevent that from happening.
a1b388
---
a1b388
 daemon/gdm-local-display-factory.c | 8 ++++++++
a1b388
 1 file changed, 8 insertions(+)
a1b388
a1b388
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
a1b388
index be6b377be..13d56dcff 100644
a1b388
--- a/daemon/gdm-local-display-factory.c
a1b388
+++ b/daemon/gdm-local-display-factory.c
a1b388
@@ -607,70 +607,78 @@ on_seat_removed (GDBusConnection *connection,
a1b388
         g_variant_get (parameters, "(&s&o)", &seat, NULL);
a1b388
         delete_display (GDM_LOCAL_DISPLAY_FACTORY (user_data), seat);
a1b388
 }
a1b388
 
a1b388
 #if defined(ENABLE_WAYLAND_SUPPORT) && defined(ENABLE_USER_DISPLAY_SERVER)
a1b388
 static gboolean
a1b388
 lookup_by_session_id (const char *id,
a1b388
                       GdmDisplay *display,
a1b388
                       gpointer    user_data)
a1b388
 {
a1b388
         const char *looking_for = user_data;
a1b388
         const char *current;
a1b388
 
a1b388
         current = gdm_display_get_session_id (display);
a1b388
         return g_strcmp0 (current, looking_for) == 0;
a1b388
 }
a1b388
 
a1b388
 static gboolean
a1b388
 wait_to_finish_timeout (GdmLocalDisplayFactory *factory)
a1b388
 {
a1b388
         finish_waiting_displays_on_seat (factory, "seat0");
a1b388
         factory->priv->wait_to_finish_timeout_id = 0;
a1b388
         return G_SOURCE_REMOVE;
a1b388
 }
a1b388
 
a1b388
 static void
a1b388
 maybe_stop_greeter_in_background (GdmLocalDisplayFactory *factory,
a1b388
                                   GdmDisplay             *display)
a1b388
 {
a1b388
         g_autofree char *display_session_type = NULL;
a1b388
+        gboolean doing_initial_setup = FALSE;
a1b388
 
a1b388
         if (gdm_display_get_status (display) != GDM_DISPLAY_MANAGED) {
a1b388
                 g_debug ("GdmLocalDisplayFactory: login window not in managed state, so ignoring");
a1b388
                 return;
a1b388
         }
a1b388
 
a1b388
         g_object_get (G_OBJECT (display),
a1b388
                       "session-type", &display_session_type,
a1b388
+                      "doing-initial-setup", &doing_initial_setup,
a1b388
                       NULL);
a1b388
 
a1b388
+        /* we don't ever stop initial-setup implicitly */
a1b388
+        if (doing_initial_setup) {
a1b388
+                g_debug ("GdmLocalDisplayFactory: login window is performing initial-setup, so ignoring");
a1b388
+                return;
a1b388
+        }
a1b388
+
a1b388
         /* we can only stop greeter for wayland sessions, since
a1b388
          * X server would jump back on exit */
a1b388
         if (g_strcmp0 (display_session_type, "wayland") != 0) {
a1b388
                 g_debug ("GdmLocalDisplayFactory: login window is running on Xorg, so ignoring");
a1b388
                 return;
a1b388
         }
a1b388
 
a1b388
         g_debug ("GdmLocalDisplayFactory: killing login window once its unused");
a1b388
         g_object_set (G_OBJECT (display), "status", GDM_DISPLAY_WAITING_TO_FINISH, NULL);
a1b388
 
a1b388
         /* We stop the greeter after a timeout to avoid flicker */
a1b388
         if (factory->priv->wait_to_finish_timeout_id != 0)
a1b388
                 g_source_remove (factory->priv->wait_to_finish_timeout_id);
a1b388
 
a1b388
         factory->priv->wait_to_finish_timeout_id =
a1b388
                 g_timeout_add_seconds (WAIT_TO_FINISH_TIMEOUT,
a1b388
                                        (GSourceFunc)wait_to_finish_timeout,
a1b388
                                        factory);
a1b388
 }
a1b388
 
a1b388
 static gboolean
a1b388
 on_vt_changed (GIOChannel    *source,
a1b388
                GIOCondition   condition,
a1b388
                GdmLocalDisplayFactory *factory)
a1b388
 {
a1b388
         GIOStatus status;
a1b388
         static const char *tty_of_initial_vt = "tty" GDM_INITIAL_VT;
a1b388
         g_autofree char *tty_of_previous_vt = NULL;
a1b388
         g_autofree char *tty_of_active_vt = NULL;
a1b388
         g_autofree char *login_session_id = NULL;
a1b388
-- 
a1b388
2.27.0
a1b388