Blame SOURCES/0006-daemon-ensure-is-initial-bit-is-transferred-to-new-l.patch

795d2c
From 91eee14bcd2447d78ad00e3de9d4380e423cb897 Mon Sep 17 00:00:00 2001
795d2c
From: Ray Strode <rstrode@redhat.com>
795d2c
Date: Mon, 24 Sep 2018 10:53:53 -0400
f62751
Subject: [PATCH 6/7] daemon: ensure is-initial bit is transferred to new login
795d2c
 screen at logout
795d2c
795d2c
At the moment, when a user logs out we call sync_seats to restart the
795d2c
login screen. sync_seats doesn't know whether or not vt1 is occupied.
795d2c
795d2c
This commit changes the code to call the more targeted `create_display`
795d2c
function, which we can inform of vt1's availability by the is_initial
795d2c
flag.
795d2c
---
795d2c
 daemon/gdm-local-display-factory.c | 8 +++-----
795d2c
 1 file changed, 3 insertions(+), 5 deletions(-)
795d2c
795d2c
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
795d2c
index cf852b55a..9a07f03ed 100644
795d2c
--- a/daemon/gdm-local-display-factory.c
795d2c
+++ b/daemon/gdm-local-display-factory.c
795d2c
@@ -257,70 +257,68 @@ on_display_status_changed (GdmDisplay             *display,
795d2c
         char            *session_type = NULL;
795d2c
         char            *session_class = NULL;
795d2c
         gboolean         is_initial = TRUE;
795d2c
         gboolean         is_local = TRUE;
795d2c
 
795d2c
         num = -1;
795d2c
         gdm_display_get_x11_display_number (display, &num, NULL);
795d2c
 
795d2c
         store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
795d2c
 
795d2c
         g_object_get (display,
795d2c
                       "seat-id", &seat_id,
795d2c
                       "is-initial", &is_initial,
795d2c
                       "is-local", &is_local,
795d2c
                       "session-type", &session_type,
795d2c
                       "session-class", &session_class,
795d2c
                       NULL);
795d2c
 
795d2c
         status = gdm_display_get_status (display);
795d2c
 
795d2c
         g_debug ("GdmLocalDisplayFactory: display status changed: %d", status);
795d2c
         switch (status) {
795d2c
         case GDM_DISPLAY_FINISHED:
795d2c
                 /* remove the display number from factory->priv->used_display_numbers
795d2c
                    so that it may be reused */
795d2c
                 if (num != -1) {
795d2c
                         g_hash_table_remove (factory->priv->used_display_numbers, GUINT_TO_POINTER (num));
795d2c
                 }
795d2c
                 gdm_display_store_remove (store, display);
795d2c
 
795d2c
-                /* if this is a local display, do a full resync.  Only
795d2c
-                 * seats without displays will get created anyway.  This
795d2c
-                 * ensures we get a new login screen when the user logs out,
795d2c
-                 * if there isn't one.
795d2c
+                /* if this is a local display, recreate the display so
795d2c
+                 * a new login screen comes up if one is missing.
795d2c
                  */
795d2c
                 if (is_local && g_strcmp0 (session_class, "greeter") != 0) {
795d2c
                         /* reset num failures */
795d2c
                         factory->priv->num_failures = 0;
795d2c
 
795d2c
-                        gdm_local_display_factory_sync_seats (factory);
795d2c
+                        create_display (factory, seat_id, session_type, is_initial);
795d2c
                 }
795d2c
                 break;
795d2c
         case GDM_DISPLAY_FAILED:
795d2c
                 /* leave the display number in factory->priv->used_display_numbers
795d2c
                    so that it doesn't get reused */
795d2c
                 gdm_display_store_remove (store, display);
795d2c
 
795d2c
                 /* Create a new equivalent display if it was static */
795d2c
                 if (is_local) {
795d2c
 
795d2c
                         factory->priv->num_failures++;
795d2c
 
795d2c
                         if (factory->priv->num_failures > MAX_DISPLAY_FAILURES) {
795d2c
                                 /* oh shit */
795d2c
                                 g_warning ("GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors");
795d2c
                         } else {
795d2c
 #ifdef ENABLE_WAYLAND_SUPPORT
795d2c
                                 if (g_strcmp0 (session_type, "wayland") == 0) {
795d2c
                                         g_free (session_type);
795d2c
                                         session_type = NULL;
795d2c
                                 }
795d2c
 
795d2c
 #endif
795d2c
                                 create_display (factory, seat_id, session_type, is_initial);
795d2c
                         }
795d2c
                 }
795d2c
                 break;
795d2c
         case GDM_DISPLAY_UNMANAGED:
795d2c
                 break;
795d2c
         case GDM_DISPLAY_PREPARED:
795d2c
-- 
795d2c
2.19.0
795d2c