Fix mouse cursor leaving the rendering area when captured

This commit is contained in:
David Hrdlička
2017-05-31 09:05:53 +02:00
parent 287323aa3a
commit d90abaa4a9

View File

@@ -326,7 +326,7 @@ void mainthread(LPVOID param)
if (mousecapture)
{
GetWindowRect(ghwnd, &r);
GetWindowRect(hwndRender, &r);
ClipCursor(&r);
}
@@ -2059,7 +2059,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (!mousecapture && !video_fullscreen)
{
GetClipCursor(&oldclip);
GetWindowRect(hwnd, &rect);
GetWindowRect(hwndRender, &rect);
ClipCursor(&rect);
mousecapture = 1;
@@ -2101,7 +2101,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (mousecapture)
{
GetWindowRect(hwnd, &rect);
GetWindowRect(hwndRender, &rect);
ClipCursor(&rect);
}