[systemd-commits] src/login

David Herrmann dvdhrm at kemper.freedesktop.org
Tue Jul 8 03:58:13 PDT 2014


 src/login/logind-seat.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 154034270c4643b7cfe61c0be1676d78bb1b7b07
Author: David Herrmann <dh.herrmann at gmail.com>
Date:   Tue Jul 8 12:56:55 2014 +0200

    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 at mecheye.net>
    Signed-off-by: David Herrmann <dh.herrmann at gmail.com>

diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index 3114de8..9992195 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -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]);
 }



More information about the systemd-commits mailing list