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

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