From 5bf61ca7edb658737f3ccbaed0a99f4779d329bb Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 5 Aug 2017 23:08:35 -0400 Subject: Check for multi backend before using it --- examples/shared.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples') 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); + } } } } -- cgit v1.2.3