1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-03 08:19:41 +00:00

win32u: Cancel previous key auto-repeat when starting a new one.

The previous auto-repeat may be associated with a different HWND,
so we cannot rely on the new timer replacing the old timer, and
we don't want simultaneous repeats on different windows in the
same thread.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56307
This commit is contained in:
Alexandros Frantzis 2024-03-15 10:48:09 +02:00 committed by Alexandre Julliard
parent 7a25bd885e
commit e63da6ea68

View File

@ -2425,6 +2425,8 @@ static BOOL process_keyboard_message( MSG *msg, UINT hw_id, HWND hwnd_filter,
if (msg->wParam == VK_PROCESSKEY) break;
if (thread_info->key_repeat_msg.hwnd != msg->hwnd)
kill_system_timer( thread_info->key_repeat_msg.hwnd, SYSTEM_TIMER_KEY_REPEAT );
thread_info->key_repeat_msg = *msg;
if (NtUserSystemParametersInfo( SPI_GETKEYBOARDDELAY, 0, &delay, 0 ))
NtUserSetSystemTimer( msg->hwnd, SYSTEM_TIMER_KEY_REPEAT, (delay + 1) * 250 );