mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
fix for bad cursor position on alt+enter
This commit is contained in:
parent
a85a7533e3
commit
241ccad68c
18
src/main.c
18
src/main.c
@ -422,23 +422,24 @@ LRESULT CALLBACK dummy_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||||||
|
|
||||||
void ToggleFullscreen()
|
void ToggleFullscreen()
|
||||||
{
|
{
|
||||||
|
if (!ddraw->locked)
|
||||||
|
return;
|
||||||
|
|
||||||
if (ddraw->windowed)
|
if (ddraw->windowed)
|
||||||
{
|
{
|
||||||
|
mouse_unlock();
|
||||||
if(ChangeDisplaySettings(&ddraw->render.mode, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL)
|
if(ChangeDisplaySettings(&ddraw->render.mode, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
ddraw->windowed = FALSE;
|
ddraw->windowed = FALSE;
|
||||||
|
|
||||||
SetWindowLong(ddraw->hWnd, GWL_STYLE, GetWindowLong(ddraw->hWnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
SetWindowLong(ddraw->hWnd, GWL_STYLE, GetWindowLong(ddraw->hWnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
||||||
SetWindowPos(ddraw->hWnd, HWND_TOPMOST, 0, 0, ddraw->render.width, ddraw->render.height, SWP_SHOWWINDOW);
|
SetWindowPos(ddraw->hWnd, HWND_TOPMOST, 0, 0, ddraw->render.width, ddraw->render.height, SWP_SHOWWINDOW);
|
||||||
if (ddraw->locked)
|
|
||||||
{
|
|
||||||
mouse_unlock();
|
|
||||||
mouse_lock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
mouse_lock();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
mouse_unlock();
|
||||||
if(ChangeDisplaySettings(&ddraw->mode, 0) == DISP_CHANGE_SUCCESSFUL)
|
if(ChangeDisplaySettings(&ddraw->mode, 0) == DISP_CHANGE_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
if (!ddraw->border)
|
if (!ddraw->border)
|
||||||
@ -456,15 +457,10 @@ void ToggleFullscreen()
|
|||||||
AdjustWindowRect(&dst, GetWindowLong(ddraw->hWnd, GWL_STYLE), FALSE);
|
AdjustWindowRect(&dst, GetWindowLong(ddraw->hWnd, GWL_STYLE), FALSE);
|
||||||
SetWindowPos(ddraw->hWnd, HWND_NOTOPMOST, dst.left, dst.top, (dst.right - dst.left), (dst.bottom - dst.top), SWP_SHOWWINDOW);
|
SetWindowPos(ddraw->hWnd, HWND_NOTOPMOST, dst.left, dst.top, (dst.right - dst.left), (dst.bottom - dst.top), SWP_SHOWWINDOW);
|
||||||
|
|
||||||
if (ddraw->locked)
|
|
||||||
{
|
|
||||||
mouse_unlock();
|
|
||||||
mouse_lock();
|
|
||||||
}
|
|
||||||
|
|
||||||
ddraw->windowed = TRUE;
|
ddraw->windowed = TRUE;
|
||||||
ddraw->windowed_init = TRUE;
|
ddraw->windowed_init = TRUE;
|
||||||
}
|
}
|
||||||
|
mouse_lock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user