mirror of https://github.com/libsdl-org/SDL.git
Fix for 500ms hang after user clicks on the title bar, but before moving (#12217)
Reference: https://gamedev.net/forums/topic/672094-keeping-things-moving-during-win32-moveresize-events/5254386/
This commit is contained in:
parent
a0b6c0fd8f
commit
69d28027ad
|
|
@ -1525,6 +1525,15 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
|
||||||
case WM_NCLBUTTONDOWN:
|
case WM_NCLBUTTONDOWN:
|
||||||
{
|
{
|
||||||
data->in_title_click = true;
|
data->in_title_click = true;
|
||||||
|
|
||||||
|
// Fix for 500ms hang after user clicks on the title bar, but before moving mouse
|
||||||
|
// Reference: https://gamedev.net/forums/topic/672094-keeping-things-moving-during-win32-moveresize-events/5254386/
|
||||||
|
if (SendMessage(hwnd, WM_NCHITTEST, wParam, lParam) == HTCAPTION) {
|
||||||
|
POINT cursorPos;
|
||||||
|
GetCursorPos(&cursorPos);
|
||||||
|
ScreenToClient(hwnd, &cursorPos);
|
||||||
|
PostMessage(hwnd, WM_MOUSEMOVE, 0, cursorPos.x | cursorPos.y << 16);
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case WM_CAPTURECHANGED:
|
case WM_CAPTURECHANGED:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue