mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 13:41:31 +00:00
logind: allow switching to unused VTs via SwitchTo()
If compositors use the new SwitchTo() logic to map F1-F12, we should allow
them to switch to unregistered VTs, too. Otherwise, the auto-spawn logic
of gettys won't trigger.
Reported-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
(cherry picked from commit 154034270c)
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
539fc6acb2
commit
a1a46db860
@@ -275,8 +275,13 @@ int seat_switch_to(Seat *s, unsigned int num) {
|
||||
if (!num)
|
||||
return -EINVAL;
|
||||
|
||||
if (num >= s->position_count || !s->positions[num])
|
||||
if (num >= s->position_count || !s->positions[num]) {
|
||||
/* allow switching to unused VTs to trigger auto-activate */
|
||||
if (seat_has_vts(s) && num < 64)
|
||||
return chvt(num);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return session_activate(s->positions[num]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user