Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/wayland_keyboard.c:
+ /* If the vkey already has the requested lock state there is nothing to do. */ + if (prev_lock == lock) return; + + TRACE_(key)("vkey=0x%03x lock=%d state=0x%02x\n", vkey, lock, keystate[vkey]); + + send_vkey(hwnd, vkey, 0); + send_vkey(hwnd, vkey, KEYEVENTF_KEYUP); + + /* Ensure we have the proper state in case key events were blocked by hooks. */ + if (get_async_key_state(keystate) && !!(keystate[vkey] & 0x01) == prev_lock) + { + WARN("keystate %x not changed (%#.2x), probably blocked by hooks\n", + vkey, keystate[vkey]); + keystate[vkey] ^= 0x01; + set_async_key_state(keystate); + } I understand the need to update the keyboard state, and I know winex11 does this, but sending key input when window gains focus feels wrong to me.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5712#note_71273