Blob Blame History Raw
From 053106dc82ff66206a78a496b845249be9173584 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Thu, 11 Oct 2018 07:15:56 -0400
Subject: [PATCH 47/48] local-display-factory: kill X on login just like
 wayland

These days we kill the wayland login screen during login to
conserve system resources.

We've been reluctant to do the same for X based login screens,
because X didn't handle being killed in the background so well.

This is no longer a problem, since this commit:

https://gitlab.freedesktop.org/xorg/xserver/-/commit/ff91c696ff8f5f56da40e107cb5c321539758a81

So let's go ahead and kill it now.
---
 daemon/gdm-local-display-factory.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index a288f8765..aae226750 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -599,86 +599,77 @@ 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;
         g_autofree char *tty_of_active_vt = NULL;
         g_autofree char *login_session_id = NULL;
         g_autofree char *active_session_id = NULL;
         unsigned int previous_vt, new_vt;
         const char *session_type = NULL;
         int ret, n_returned;
 
         g_debug ("GdmLocalDisplayFactory: received VT change event");
         g_io_channel_seek_position (source, 0, G_SEEK_SET, NULL);
 
         if (condition & G_IO_PRI) {
-- 
2.26.0