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

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