https://bugs.winehq.org/show_bug.cgi?id=29871
--- Comment #40 from Sebastian Lackner sebastian@fds-team.de --- Thanks to Béla for providing a "more affordable" testcase (see https://bugs.wine-staging.com/show_bug.cgi?id=155). ;)
Relevant lines from the log:
--- snip --- 0028:fixme:msg:send_hardware_message validate keystate, state = 0x01 [...] 002b:trace:msg:peek_message calling mouse LL hook pos 453,195 data 0 flags 0 time 424441724 info 0 002b:trace:hook:call_hook calling hook 0xee040cbb WH_MOUSE_LL code 0 wp 201 lp 5e8e824 module L"" 002b:Ret hook proc 0xee040cbb (id=WH_MOUSE_LL,code=0,wp=00000201,lp=05e8e824) retval=00000000 002b:fixme:hook:call_hook invalidating key state [...] 0028:trace:msg:peek_message got type 7 msg 201 (WM_LBUTTONDOWN) hwnd 0x2006c wp 1 lp 0 [...] 0028:Call user32.GetAsyncKeyState(00000001) ret=023a82c6 0028:fixme:win:GetAsyncKeyState cached = 0x01, wineserver = 0x80 --- snip ---
Invalidating the async key state in one thread should also invalidate it on other threads. This means my attempt earlier was almost right ... I only forgot a single line! :(
Will attach an updated patch shortly.