Commit c71bc5d6 authored by Hans de Goede's avatar Hans de Goede Committed by Ray Strode

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.
parent 39fb4ff6
......@@ -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";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment