Mouse capture clipping now updated when window resized.
This commit is contained in:
parent
a8b286a2ec
commit
7416a24e99
1 changed files with 21 additions and 7 deletions
28
src/win.c
28
src/win.c
|
|
@ -76,7 +76,7 @@ void vsyncint()
|
||||||
int romspresent[26];
|
int romspresent[26];
|
||||||
int quited=0;
|
int quited=0;
|
||||||
|
|
||||||
RECT oldclip,pcclip;
|
RECT oldclip;
|
||||||
int mousecapture=0;
|
int mousecapture=0;
|
||||||
int drawit;
|
int drawit;
|
||||||
/* Declare Windows procedure */
|
/* Declare Windows procedure */
|
||||||
|
|
@ -1589,14 +1589,16 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
if (!mousecapture)
|
if (!mousecapture)
|
||||||
{
|
{
|
||||||
|
RECT pcclip;
|
||||||
|
|
||||||
GetClipCursor(&oldclip);
|
GetClipCursor(&oldclip);
|
||||||
GetWindowRect(hwnd,&pcclip);
|
GetWindowRect(hwnd, &pcclip);
|
||||||
pcclip.left+=GetSystemMetrics(SM_CXFIXEDFRAME)+10;
|
pcclip.left += GetSystemMetrics(SM_CXFIXEDFRAME) + 10;
|
||||||
pcclip.right-=GetSystemMetrics(SM_CXFIXEDFRAME)+10;
|
pcclip.right -= GetSystemMetrics(SM_CXFIXEDFRAME) + 10;
|
||||||
pcclip.top+=GetSystemMetrics(SM_CXFIXEDFRAME)+GetSystemMetrics(SM_CYMENUSIZE)+GetSystemMetrics(SM_CYCAPTION)+10;
|
pcclip.top += GetSystemMetrics(SM_CXFIXEDFRAME) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 10;
|
||||||
pcclip.bottom-=GetSystemMetrics(SM_CXFIXEDFRAME)+10;
|
pcclip.bottom -= GetSystemMetrics(SM_CXFIXEDFRAME) + 10;
|
||||||
ClipCursor(&pcclip);
|
ClipCursor(&pcclip);
|
||||||
mousecapture=1;
|
mousecapture = 1;
|
||||||
ShowCursor(FALSE);
|
ShowCursor(FALSE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1615,6 +1617,18 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
vid_apis[vid_api].resize(winsizex, winsizey);
|
vid_apis[vid_api].resize(winsizex, winsizey);
|
||||||
endblit();
|
endblit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mousecapture)
|
||||||
|
{
|
||||||
|
RECT pcclip;
|
||||||
|
|
||||||
|
GetWindowRect(hwnd, &pcclip);
|
||||||
|
pcclip.left += GetSystemMetrics(SM_CXFIXEDFRAME) + 10;
|
||||||
|
pcclip.right -= GetSystemMetrics(SM_CXFIXEDFRAME) + 10;
|
||||||
|
pcclip.top += GetSystemMetrics(SM_CXFIXEDFRAME) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 10;
|
||||||
|
pcclip.bottom -= GetSystemMetrics(SM_CXFIXEDFRAME) + 10;
|
||||||
|
ClipCursor(&pcclip);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_TIMER:
|
case WM_TIMER:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue