logo

inaban

Distrustful Wayland Compositor (inspired by XMonad and dwm) git clone https://hacktivis.me/git/inaban.git
commit: 7fae3bfd628e4b3924e748dc9ffc35cb0248d79b
parent c152eed6492b2b535636c909ea093ed2191e8230
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 10 May 2021 17:53:13 +0200

Allow VT-switching when locked

Diffstat:

Minaban.c14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/inaban.c b/inaban.c @@ -60,7 +60,19 @@ keyboard_handle_key(struct wl_listener *listener, void *data) if(server->locked == true) { - // needs to be written + if( + (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) && + (keysym >= XKB_KEY_XF86Switch_VT_1 && keysym <= XKB_KEY_XF86Switch_VT_12) + ) + { + struct wlr_session *session = wlr_backend_get_session(server->backend); + if(session) + { + unsigned vt = keysym - XKB_KEY_XF86Switch_VT_1 + 1; + wlr_session_change_vt(session, vt); + } + } + return; }