Module: wine Branch: master Commit: 1e21e82859baf1298d610021c88adcbe2a529de5 URL: https://gitlab.winehq.org/wine/wine/-/commit/1e21e82859baf1298d610021c88adcb...
Author: Tim Clem tclem@codeweavers.com Date: Fri Jun 23 13:38:46 2023 -0700
win32u: Detect a missed WM_LBUTTONUP in the size/move loop.
---
dlls/win32u/defwnd.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index e5ff1a010b9..cba5f02c02e 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -788,6 +788,17 @@ static void sys_command_size_move( HWND hwnd, WPARAM wparam ) { NtUserTranslateMessage( &msg, 0 ); NtUserDispatchMessage( &msg ); + + /* It's possible that the window proc that handled the dispatch consumed a + * WM_LBUTTONUP. Detect that and terminate the loop as if we'd gotten it. */ + if (!(NtUserGetKeyState( VK_LBUTTON ) & 0x8000)) + { + DWORD last_pos = NtUserGetThreadInfo()->message_pos; + pt.x = ((int)(short)LOWORD( last_pos )); + pt.y = ((int)(short)HIWORD( last_pos )); + break; + } + continue; /* We are not interested in other messages */ }