w32_common: capture mouse input

Mouse buttons can get stuck down if the button is pressed inside the
video window and released outside. Avoid this by capturing mouse input
when a button is pressed.
This commit is contained in:
James Ross-Gowan authored and wm4 committed 2014-03-12 14:51:07 +01:00
1 parent b05803c2e1
commit 6402b9dc38
1 file changed
+5
+5
View File
@@ -465,6 +465,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
return 0;
}
}
if (mouse_button & MP_KEY_STATE_DOWN)
SetCapture(w32->window);
else
ReleaseCapture();
}
return DefWindowProcW(hWnd, message, wParam, lParam);