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

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