aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-08-05 23:08:35 -0400
committerDrew DeVault <sir@cmpwn.com>2017-08-05 23:08:35 -0400
commit5bf61ca7edb658737f3ccbaed0a99f4779d329bb (patch)
tree0e29dfa81a30d6172c558d2b5df6d95f31a32b20 /examples
parentf1a069d50df7be30a0ae3cef763bb7337d88dbfc (diff)
Check for multi backend before using it
Diffstat (limited to 'examples')
-rw-r--r--examples/shared.c10
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);
+ }
}
}
}