diff options
author | Dudemanguy <random342@airmail.cc> | 2020-12-20 10:53:29 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2020-12-20 10:57:48 -0600 |
commit | 1ba5dc84caa1dfe4ee39e8a9947f863b43a52263 (patch) | |
tree | 4e62f367009e8a671f15ac06e963c8c1c96a67a8 /video | |
parent | dde01892791c64183341120409d0f7eef6d60749 (diff) | |
download | mpv-1ba5dc84caa1dfe4ee39e8a9947f863b43a52263.tar.bz2 mpv-1ba5dc84caa1dfe4ee39e8a9947f863b43a52263.tar.xz |
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.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/wayland_common.c | 6 |
1 files changed, 4 insertions, 2 deletions
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, |