[gdm/wip/gdm-vt-switch-fixes: 4/6] local-display-factory: Remove initial VT is in use check



commit c71bc5d6c3bc2ec448b5c72ce9a811d9c0c7905e
Author: Hans de Goede <hdegoede redhat com>
Date:   Tue Sep 4 08:12:34 2018 +0200

    local-display-factory: Remove initial VT is in use check
    
    The initial VT is in use check in on_vt_changed() is racy, when switching
    to VT1 from an active session, on_vt_changed() may run before logind has
    processed the VT change and then sd_seat_get_active() will return the
    active session which we are switching away from. This results in the greeter
    not being started on VT1.
    
    On my system gdm reliably wins the race resulting in not getting a greeter
    when manually switching from an active session to VT1.
    
    gdm already starts the greeter unconditionally from
    gdm_local_display_factory_sync_seats() on both startup and when an user
    session exits. gdm also starts it unconditionally when selecting
    "Switch user" from an user session.
    
    Now autologin sessions avoid the initial VT as well.
    
    So we now can assume that the initial VT is free for the login screen's
    use. And create_display already checks for and re-uses
    an existing greeter, so we can safely remove the racy check.

 daemon/gdm-local-display-factory.c | 13 -------------
 1 file changed, 13 deletions(-)
---
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index fc6865eb..be4bac0a 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -774,19 +774,6 @@ on_vt_changed (GIOChannel    *source,
                 return G_SOURCE_CONTINUE;
         }
 
-        ret = sd_seat_get_active ("seat0", &active_session_id, NULL);
-
-        if (ret == 0) {
-                g_autofree char *state = NULL;
-                ret = sd_session_get_state (active_session_id, &state);
-
-                /* if there's something already running on the active VT then bail */
-                if (ret == 0 && g_strcmp0 (state, "closing") != 0) {
-                        g_debug ("GdmLocalDisplayFactory: initial VT is in use, so ignoring");
-                        return G_SOURCE_CONTINUE;
-                }
-        }
-
         if (gdm_local_display_factory_use_wayland ())
                 session_type = "wayland";
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]