From 1ba5dc84caa1dfe4ee39e8a9947f863b43a52263 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sun, 20 Dec 2020 10:53:29 -0600 Subject: wayland: support multiple modifiers Oversight when the modifier checking was split out to a separate function. Instead of immediately returning on a match, be sure to loop through all modifiers and catch every single one that is pressed before we return them. --- video/out/wayland_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'video/out/wayland_common.c') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 4afd4c0999..fe9c0b531c 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -141,14 +141,16 @@ static int get_mods(struct vo_wayland_state *wl) MP_KEY_MODIFIER_META, }; + int modifiers = 0; + for (int n = 0; n < MP_ARRAY_SIZE(mods); n++) { xkb_mod_index_t index = xkb_keymap_mod_get_index(wl->xkb_keymap, mod_names[n]); if (!xkb_state_mod_index_is_consumed(wl->xkb_state, wl->keyboard_code, index) && xkb_state_mod_index_is_active(wl->xkb_state, index, XKB_STATE_MODS_DEPRESSED)) - return mods[n]; + modifiers |= mods[n]; } - return 0; + return modifiers; } static void pointer_handle_enter(void *data, struct wl_pointer *pointer, -- cgit v1.2.3