mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
Check for multi backend before using it
This commit is contained in:
parent
f1a069d50d
commit
5bf61ca7ed
3 changed files with 12 additions and 4 deletions
|
|
@ -48,10 +48,12 @@ static void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
|||
} else if (key_state == WLR_KEY_PRESSED &&
|
||||
sym >= XKB_KEY_XF86Switch_VT_1 &&
|
||||
sym <= XKB_KEY_XF86Switch_VT_12) {
|
||||
struct wlr_session *session =
|
||||
wlr_multi_get_session(kbstate->compositor->backend);
|
||||
if (session) {
|
||||
wlr_session_change_vt(session, sym - XKB_KEY_XF86Switch_VT_1 + 1);
|
||||
if (wlr_backend_is_multi(kbstate->compositor->backend)) {
|
||||
struct wlr_session *session =
|
||||
wlr_multi_get_session(kbstate->compositor->backend);
|
||||
if (session) {
|
||||
wlr_session_change_vt(session, sym - XKB_KEY_XF86Switch_VT_1 + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue