diff options
-rw-r--r-- | video/out/wayland_common.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 6311e34d13..9b901d9f40 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -395,7 +395,6 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard, state = state == WL_KEYBOARD_KEY_STATE_PRESSED ? MP_KEY_STATE_DOWN : MP_KEY_STATE_UP; - int mpmod = get_mods(wl); int mpkey = lookupkey(sym); if (mpkey) { @@ -414,8 +413,10 @@ static void keyboard_handle_modifiers(void *data, struct wl_keyboard *wl_keyboar { struct vo_wayland_state *wl = data; - xkb_state_update_mask(wl->xkb_state, mods_depressed, mods_latched, - mods_locked, 0, 0, group); + if (wl->xkb_state) { + xkb_state_update_mask(wl->xkb_state, mods_depressed, mods_latched, + mods_locked, 0, 0, group); + } } static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *wl_keyboard, |