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

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