summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-08-13 13:59:45 -0500
committerDudemanguy <random342@airmail.cc>2023-08-14 21:55:20 +0000
commit221a574a503604fbda6f25f171852d99e49de06b (patch)
tree540d27a8fd29412f7bbf785057225a05920cc188 /video
parent64db68639dd56edbd0de4d3c71f75ab14f9bc135 (diff)
downloadmpv-221a574a503604fbda6f25f171852d99e49de06b.tar.bz2
mpv-221a574a503604fbda6f25f171852d99e49de06b.tar.xz
wayland: clear saved mpkey more aggressively
Introduced by 1f8013ff3fddd788a517656e09f5ce5d7efd928d. We try to save the mpkey so it can be used in the modifier event that comes next if appropriate and also clear it when needed. The problem is that the condition for clearing is too strict and things like mismatched cases and so on can make mpkey on the corresponding key release event not match the saved mpkey even though in reality they were the same key. Loosen the check by simply always clearing the saved mpkey as long as there was some key found and the state is up. We don't handle multiple keys at the same time anyways (they're interpreted in a sequence), so it should be hopefully OK.
Diffstat (limited to 'video')
-rw-r--r--video/out/wayland_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 90d4e162e4..7c5e0e6a93 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -452,7 +452,7 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard,
}
if (state == MP_KEY_STATE_DOWN)
wl->mpkey = mpkey;
- if (wl->mpkey == mpkey && state == MP_KEY_STATE_UP)
+ if (mpkey && state == MP_KEY_STATE_UP)
wl->mpkey = 0;
}