Blame SOURCES/0045-local-display-factory-Always-force-login-screen-to-V.patch

400dab
From fc3503f16e9de535d2a36b904720b360370f880f Mon Sep 17 00:00:00 2001
400dab
From: Ray Strode <rstrode@redhat.com>
400dab
Date: Fri, 15 May 2020 10:08:24 -0400
400dab
Subject: [PATCH 45/51] local-display-factory: Always force login screen to VT
400dab
 1
400dab
400dab
These days we always want the login screen on VT 1, even
400dab
when it's created by user switching.
400dab
400dab
Unfortunately, since commit f843233ad the login screen
400dab
won't naturally pick VT 1 when user switching.
400dab
400dab
This commit forces it to make the right choice.
400dab
400dab
Closes https://gitlab.gnome.org/GNOME/gdm/-/issues/602
400dab
---
400dab
 daemon/gdm-local-display-factory.c | 3 +++
400dab
 1 file changed, 3 insertions(+)
400dab
400dab
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
400dab
index 7a013c694..a288f8765 100644
400dab
--- a/daemon/gdm-local-display-factory.c
400dab
+++ b/daemon/gdm-local-display-factory.c
400dab
@@ -197,84 +197,87 @@ store_display (GdmLocalDisplayFactory *factory,
400dab
         gdm_display_store_add (store, display);
400dab
 }
400dab
 
400dab
 static gboolean
400dab
 gdm_local_display_factory_use_wayland (void)
400dab
 {
400dab
 #ifdef ENABLE_WAYLAND_SUPPORT
400dab
         gboolean wayland_enabled = FALSE;
400dab
         if (gdm_settings_direct_get_boolean (GDM_KEY_WAYLAND_ENABLE, &wayland_enabled)) {
400dab
                 if (wayland_enabled && g_file_test ("/usr/bin/Xwayland", G_FILE_TEST_IS_EXECUTABLE) )
400dab
                         return TRUE;
400dab
         }
400dab
 #endif
400dab
         return FALSE;
400dab
 }
400dab
 
400dab
 /*
400dab
   Example:
400dab
   dbus-send --system --dest=org.gnome.DisplayManager \
400dab
   --type=method_call --print-reply --reply-timeout=2000 \
400dab
   /org/gnome/DisplayManager/Manager \
400dab
   org.gnome.DisplayManager.Manager.GetDisplays
400dab
 */
400dab
 gboolean
400dab
 gdm_local_display_factory_create_transient_display (GdmLocalDisplayFactory *factory,
400dab
                                                     char                  **id,
400dab
                                                     GError                **error)
400dab
 {
400dab
         gboolean         ret;
400dab
         GdmDisplay      *display = NULL;
400dab
+        gboolean         is_initial = FALSE;
400dab
 
400dab
         g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE);
400dab
 
400dab
         ret = FALSE;
400dab
 
400dab
         g_debug ("GdmLocalDisplayFactory: Creating transient display");
400dab
 
400dab
 #ifdef ENABLE_USER_DISPLAY_SERVER
400dab
         display = gdm_local_display_new ();
400dab
         if (gdm_local_display_factory_use_wayland ())
400dab
                 g_object_set (G_OBJECT (display), "session-type", "wayland", NULL);
400dab
+        is_initial = TRUE;
400dab
 #else
400dab
         if (display == NULL) {
400dab
                 guint32 num;
400dab
 
400dab
                 num = take_next_display_number (factory);
400dab
 
400dab
                 display = gdm_legacy_display_new (num);
400dab
         }
400dab
 #endif
400dab
 
400dab
         g_object_set (display,
400dab
                       "seat-id", "seat0",
400dab
                       "allow-timed-login", FALSE,
400dab
+                      "is-initial", is_initial,
400dab
                       NULL);
400dab
 
400dab
         store_display (factory, display);
400dab
 
400dab
         if (! gdm_display_manage (display)) {
400dab
                 display = NULL;
400dab
                 goto out;
400dab
         }
400dab
 
400dab
         if (! gdm_display_get_id (display, id, NULL)) {
400dab
                 display = NULL;
400dab
                 goto out;
400dab
         }
400dab
 
400dab
         ret = TRUE;
400dab
  out:
400dab
         /* ref either held by store or not at all */
400dab
         g_object_unref (display);
400dab
 
400dab
         return ret;
400dab
 }
400dab
 
400dab
 static gboolean
400dab
 finish_display_on_seat_if_waiting (GdmDisplayStore *display_store,
400dab
                                    GdmDisplay      *display,
400dab
                                    const char      *seat_id)
400dab
 {
400dab
         if (gdm_display_get_status (display) != GDM_DISPLAY_WAITING_TO_FINISH)
400dab
                 return FALSE;
400dab
 
400dab
-- 
400dab
2.27.0
400dab