Blob Blame History Raw
From e071fe9ff6808c9910854755fb975a800ffdd142 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Fri, 15 May 2020 10:08:24 -0400
Subject: [PATCH 45/48] local-display-factory: Always force login screen to VT
 1

These days we always want the login screen on VT 1, even
when it's created by user switching.

Unfortunately, since commit f843233ad the login screen
won't naturally pick VT 1 when user switching.

This commit forces it to make the right choice.

Closes https://gitlab.gnome.org/GNOME/gdm/-/issues/602
---
 daemon/gdm-local-display-factory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index 7a013c694..a288f8765 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -197,84 +197,87 @@ store_display (GdmLocalDisplayFactory *factory,
         gdm_display_store_add (store, display);
 }
 
 static gboolean
 gdm_local_display_factory_use_wayland (void)
 {
 #ifdef ENABLE_WAYLAND_SUPPORT
         gboolean wayland_enabled = FALSE;
         if (gdm_settings_direct_get_boolean (GDM_KEY_WAYLAND_ENABLE, &wayland_enabled)) {
                 if (wayland_enabled && g_file_test ("/usr/bin/Xwayland", G_FILE_TEST_IS_EXECUTABLE) )
                         return TRUE;
         }
 #endif
         return FALSE;
 }
 
 /*
   Example:
   dbus-send --system --dest=org.gnome.DisplayManager \
   --type=method_call --print-reply --reply-timeout=2000 \
   /org/gnome/DisplayManager/Manager \
   org.gnome.DisplayManager.Manager.GetDisplays
 */
 gboolean
 gdm_local_display_factory_create_transient_display (GdmLocalDisplayFactory *factory,
                                                     char                  **id,
                                                     GError                **error)
 {
         gboolean         ret;
         GdmDisplay      *display = NULL;
+        gboolean         is_initial = FALSE;
 
         g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE);
 
         ret = FALSE;
 
         g_debug ("GdmLocalDisplayFactory: Creating transient display");
 
 #ifdef ENABLE_USER_DISPLAY_SERVER
         display = gdm_local_display_new ();
         if (gdm_local_display_factory_use_wayland ())
                 g_object_set (G_OBJECT (display), "session-type", "wayland", NULL);
+        is_initial = TRUE;
 #else
         if (display == NULL) {
                 guint32 num;
 
                 num = take_next_display_number (factory);
 
                 display = gdm_legacy_display_new (num);
         }
 #endif
 
         g_object_set (display,
                       "seat-id", "seat0",
                       "allow-timed-login", FALSE,
+                      "is-initial", is_initial,
                       NULL);
 
         store_display (factory, display);
 
         if (! gdm_display_manage (display)) {
                 display = NULL;
                 goto out;
         }
 
         if (! gdm_display_get_id (display, id, NULL)) {
                 display = NULL;
                 goto out;
         }
 
         ret = TRUE;
  out:
         /* ref either held by store or not at all */
         g_object_unref (display);
 
         return ret;
 }
 
 static gboolean
 finish_display_on_seat_if_waiting (GdmDisplayStore *display_store,
                                    GdmDisplay      *display,
                                    const char      *seat_id)
 {
         if (gdm_display_get_status (display) != GDM_DISPLAY_WAITING_TO_FINISH)
                 return FALSE;
 
-- 
2.26.0