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

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