Signed-off-by: Jacek Caban jacek@codeweavers.com ---
This fixes https://github.com/ValveSoftware/Proton/issues/911
If the game is ran with numlock enabled, Wine will try to sync on the first key event. The game uses dinput in exclusive mode, so our low level keyboard hook prevents simulated numlock press in update_lock_state. Thus, we simulate the same key press again on following key events. It means that all key events will result in two events on Wine side: (simulated) numlock press and the actual key press. The patch avoids that by forcing Wine-side state to be the same as X server state.
For this particular case, the game could theoretically be fixed on dinput side (as part of rewrite on top of HID?), but it's still a bug in winex11.drv that any other hooks could expose.
dlls/winex11.drv/keyboard.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-)