wayland: clear all keys on keyboard_handle_leave

There was no known problem with this, but according to the wayland
spec*, "After this event client must assume that no keys are
pressed...", so go ahead and do that.

*: 72da004b3e/protocol/wayland.xml (L2449)
This commit is contained in:
Dudemanguy 2023-08-13 14:50:27 -05:00
parent 221a574a50
commit 9d7638a6f2
1 changed files with 4 additions and 0 deletions

View File

@ -423,6 +423,10 @@ static void keyboard_handle_leave(void *data, struct wl_keyboard *wl_keyboard,
{
struct vo_wayland_state *wl = data;
wl->has_keyboard_input = false;
wl->keyboard_code = 0;
wl->mpkey = 0;
wl->mpmod = 0;
mp_input_put_key(wl->vo->input_ctx, MP_INPUT_RELEASE_ALL);
guess_focus(wl);
}