Blame SOURCES/0047-local-display-factory-kill-X-on-login-just-like-wayl.patch

400dab
From a1c74e2e42dea464ab0b439b767da5c12cbf3986 Mon Sep 17 00:00:00 2001
400dab
From: Ray Strode <rstrode@redhat.com>
400dab
Date: Thu, 11 Oct 2018 07:15:56 -0400
400dab
Subject: [PATCH 47/51] local-display-factory: kill X on login just like
400dab
 wayland
400dab
400dab
These days we kill the wayland login screen during login to
400dab
conserve system resources.
400dab
400dab
We've been reluctant to do the same for X based login screens,
400dab
because X didn't handle being killed in the background so well.
400dab
400dab
This is no longer a problem, since this commit:
400dab
400dab
https://gitlab.freedesktop.org/xorg/xserver/-/commit/ff91c696ff8f5f56da40e107cb5c321539758a81
400dab
400dab
So let's go ahead and kill it now.
400dab
---
400dab
 daemon/gdm-local-display-factory.c | 9 ---------
400dab
 1 file changed, 9 deletions(-)
400dab
400dab
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
400dab
index a288f8765..aae226750 100644
400dab
--- a/daemon/gdm-local-display-factory.c
400dab
+++ b/daemon/gdm-local-display-factory.c
400dab
@@ -599,86 +599,77 @@ on_seat_removed (GDBusConnection *connection,
400dab
 
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
         g_autofree char *tty_of_active_vt = NULL;
400dab
         g_autofree char *login_session_id = NULL;
400dab
         g_autofree char *active_session_id = NULL;
400dab
         unsigned int previous_vt, new_vt;
400dab
         const char *session_type = NULL;
400dab
         int ret, n_returned;
400dab
 
400dab
         g_debug ("GdmLocalDisplayFactory: received VT change event");
400dab
         g_io_channel_seek_position (source, 0, G_SEEK_SET, NULL);
400dab
 
400dab
         if (condition & G_IO_PRI) {
400dab
-- 
400dab
2.27.0
400dab