Blame SOURCES/0002-manager-start-login-screen-if-old-one-is-finished.patch

ca70cf
From 6b4402fb0bbf17803c2354e92fc448a537d2d506 Mon Sep 17 00:00:00 2001
ca70cf
From: Ray Strode <rstrode@redhat.com>
ca70cf
Date: Fri, 22 Jun 2018 14:55:39 -0400
ca70cf
Subject: [PATCH 2/7] manager: start login screen if old one is finished
ca70cf
ca70cf
Since commit 22c332ba we try to start a login screen if we end up
ca70cf
on an empty VT and there isn't one running.
ca70cf
ca70cf
Unfortunately the check for "is on an empty VT" is a little busted.
ca70cf
It counts the VT has non-empty if there's a display associated with
ca70cf
it, even if that display is in the FINISHED state about to be
ca70cf
reaped.
ca70cf
ca70cf
That means, in some cases, we'll still leave the user on an empty
ca70cf
VT with no login screen.
ca70cf
ca70cf
This commit addresses the problem by explicitly checking for
ca70cf
FINISHED displays, and proceeding even in their presense.
ca70cf
---
ca70cf
 daemon/gdm-manager.c | 2 +-
ca70cf
 1 file changed, 1 insertion(+), 1 deletion(-)
ca70cf
ca70cf
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
ca70cf
index 129cc0de4..3f5772e65 100644
ca70cf
--- a/daemon/gdm-manager.c
ca70cf
+++ b/daemon/gdm-manager.c
ca70cf
@@ -1410,61 +1410,61 @@ activate_login_window_session_on_seat (GdmManager *self,
ca70cf
         char *session_id;
ca70cf
 
ca70cf
         if (!get_login_window_session_id (seat_id, &session_id)) {
ca70cf
                 return;
ca70cf
         }
ca70cf
 
ca70cf
         activate_session_id (self, seat_id, session_id);
ca70cf
 }
ca70cf
 
ca70cf
 static void
ca70cf
 maybe_activate_other_session (GdmManager *self,
ca70cf
                               GdmDisplay *old_display)
ca70cf
 {
ca70cf
         char *seat_id = NULL;
ca70cf
         char *session_id = NULL;
ca70cf
         int ret;
ca70cf
 
ca70cf
         g_object_get (G_OBJECT (old_display),
ca70cf
                       "seat-id", &seat_id,
ca70cf
                       NULL);
ca70cf
 
ca70cf
         ret = sd_seat_get_active (seat_id, &session_id, NULL);
ca70cf
 
ca70cf
         if (ret == 0) {
ca70cf
                 GdmDisplay *display;
ca70cf
 
ca70cf
                 display = gdm_display_store_find (self->priv->display_store,
ca70cf
                                                   lookup_by_session_id,
ca70cf
                                                   (gpointer) session_id);
ca70cf
 
ca70cf
-                if (display == NULL) {
ca70cf
+                if (display == NULL || gdm_display_get_status (display) == GDM_DISPLAY_FINISHED) {
ca70cf
                         activate_login_window_session_on_seat (self, seat_id);
ca70cf
                 }
ca70cf
 
ca70cf
                 g_free (session_id);
ca70cf
         }
ca70cf
 
ca70cf
         g_free (seat_id);
ca70cf
 }
ca70cf
 
ca70cf
 static const char *
ca70cf
 get_username_for_greeter_display (GdmManager *manager,
ca70cf
                                   GdmDisplay *display)
ca70cf
 {
ca70cf
         gboolean doing_initial_setup = FALSE;
ca70cf
 
ca70cf
         g_object_get (G_OBJECT (display),
ca70cf
                       "doing-initial-setup", &doing_initial_setup,
ca70cf
                       NULL);
ca70cf
 
ca70cf
         if (doing_initial_setup) {
ca70cf
                 return INITIAL_SETUP_USERNAME;
ca70cf
         } else {
ca70cf
                 return GDM_USERNAME;
ca70cf
         }
ca70cf
 }
ca70cf
 
ca70cf
 static void
ca70cf
 set_up_automatic_login_session (GdmManager *manager,
ca70cf
                                 GdmDisplay *display)
ca70cf
 {
ca70cf
-- 
ca70cf
2.19.0
ca70cf