From 221a574a503604fbda6f25f171852d99e49de06b Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sun, 13 Aug 2023 13:59:45 -0500 Subject: [PATCH] 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. --- video/out/wayland_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }