diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-05 23:08:35 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-08-05 23:08:35 -0400 |
commit | 5bf61ca7edb658737f3ccbaed0a99f4779d329bb (patch) | |
tree | 0e29dfa81a30d6172c558d2b5df6d95f31a32b20 /examples | |
parent | f1a069d50df7be30a0ae3cef763bb7337d88dbfc (diff) |
Check for multi backend before using it
Diffstat (limited to 'examples')
-rw-r--r-- | examples/shared.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/shared.c b/examples/shared.c index 27e5b9ca..c66b8a23 100644 --- a/examples/shared.c +++ b/examples/shared.c @@ -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); + } } } } |