Blob Blame History Raw
From 9a78b7fe13a425d23ecbf13527daf425663fba8e Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 25 Sep 2018 14:52:15 -0400
Subject: [PATCH 31/48] local-display-factory: don't autoreap initial-setup

We automatically kill the login screen when switching VTs away
from it, but we should never kill the initial-setup screen in
that situation.

This commit adds a check to prevent that from happening.
---
 daemon/gdm-local-display-factory.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index be6b377be..13d56dcff 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -607,70 +607,78 @@ on_seat_removed (GDBusConnection *connection,
         g_variant_get (parameters, "(&s&o)", &seat, NULL);
         delete_display (GDM_LOCAL_DISPLAY_FACTORY (user_data), seat);
 }
 
 #if defined(ENABLE_WAYLAND_SUPPORT) && defined(ENABLE_USER_DISPLAY_SERVER)
 static gboolean
 lookup_by_session_id (const char *id,
                       GdmDisplay *display,
                       gpointer    user_data)
 {
         const char *looking_for = user_data;
         const char *current;
 
         current = gdm_display_get_session_id (display);
         return g_strcmp0 (current, looking_for) == 0;
 }
 
 static gboolean
 wait_to_finish_timeout (GdmLocalDisplayFactory *factory)
 {
         finish_waiting_displays_on_seat (factory, "seat0");
         factory->priv->wait_to_finish_timeout_id = 0;
         return G_SOURCE_REMOVE;
 }
 
 static void
 maybe_stop_greeter_in_background (GdmLocalDisplayFactory *factory,
                                   GdmDisplay             *display)
 {
         g_autofree char *display_session_type = NULL;
+        gboolean doing_initial_setup = FALSE;
 
         if (gdm_display_get_status (display) != GDM_DISPLAY_MANAGED) {
                 g_debug ("GdmLocalDisplayFactory: login window not in managed state, so ignoring");
                 return;
         }
 
         g_object_get (G_OBJECT (display),
                       "session-type", &display_session_type,
+                      "doing-initial-setup", &doing_initial_setup,
                       NULL);
 
+        /* we don't ever stop initial-setup implicitly */
+        if (doing_initial_setup) {
+                g_debug ("GdmLocalDisplayFactory: login window is performing initial-setup, so ignoring");
+                return;
+        }
+
         /* we can only stop greeter for wayland sessions, since
          * X server would jump back on exit */
         if (g_strcmp0 (display_session_type, "wayland") != 0) {
                 g_debug ("GdmLocalDisplayFactory: login window is running on Xorg, so ignoring");
                 return;
         }
 
         g_debug ("GdmLocalDisplayFactory: killing login window once its unused");
         g_object_set (G_OBJECT (display), "status", GDM_DISPLAY_WAITING_TO_FINISH, NULL);
 
         /* We stop the greeter after a timeout to avoid flicker */
         if (factory->priv->wait_to_finish_timeout_id != 0)
                 g_source_remove (factory->priv->wait_to_finish_timeout_id);
 
         factory->priv->wait_to_finish_timeout_id =
                 g_timeout_add_seconds (WAIT_TO_FINISH_TIMEOUT,
                                        (GSourceFunc)wait_to_finish_timeout,
                                        factory);
 }
 
 static gboolean
 on_vt_changed (GIOChannel    *source,
                GIOCondition   condition,
                GdmLocalDisplayFactory *factory)
 {
         GIOStatus status;
         static const char *tty_of_initial_vt = "tty" GDM_INITIAL_VT;
         g_autofree char *tty_of_previous_vt = NULL;
         g_autofree char *tty_of_active_vt = NULL;
         g_autofree char *login_session_id = NULL;
-- 
2.26.0