diff options
author | llyyr <llyyr.public@gmail.com> | 2024-01-13 21:20:52 +0530 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-01-13 17:10:52 +0000 |
commit | 02533e592827a1ec9ddf2433b7f87c5f72b75281 (patch) | |
tree | e21f951b7a9ee827c9070f0536c9b2d937e0ad76 /video/out/wayland_common.c | |
parent | 43ac656b029c3681b84d7713457ab94acb50097e (diff) | |
download | mpv-02533e592827a1ec9ddf2433b7f87c5f72b75281.tar.bz2 mpv-02533e592827a1ec9ddf2433b7f87c5f72b75281.tar.xz |
wayland: don't ignore key modifiers if they were consumed
According to the xkbcommon docs, `xkb_state_mod_index_is_consumed` is
true when a modifier *may affect* key translation. A key modifier may
be consumed but not be active. See xkb documentation for this function
for further details. This breaks key modifiers in cases where
L_Shift+R_Shift for example is used to change keyboard layout with
`xkb_options grp:shifts_toggle`. Instead, replace it with a simple
check for a valid modifier.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 5c5b9b3706..02e0e404b5 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1582,7 +1582,7 @@ static int get_mods(struct vo_wayland_state *wl) 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) + if (index != XKB_MOD_INVALID && xkb_state_mod_index_is_active(wl->xkb_state, index, XKB_STATE_MODS_DEPRESSED)) modifiers |= mods[n]; |