wayland: clear saved mpkey more aggressively

Introduced by 1f8013ff3f. 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.
This commit is contained in:
Dudemanguy 2023-08-13 13:59:45 -05:00
parent 64db68639d
commit 221a574a50
1 changed files with 1 additions and 1 deletions

View File

@ -452,7 +452,7 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard,
} }
if (state == MP_KEY_STATE_DOWN) if (state == MP_KEY_STATE_DOWN)
wl->mpkey = mpkey; wl->mpkey = mpkey;
if (wl->mpkey == mpkey && state == MP_KEY_STATE_UP) if (mpkey && state == MP_KEY_STATE_UP)
wl->mpkey = 0; wl->mpkey = 0;
} }