improve cursor lock
This commit is contained in:
parent
2c2a83d93c
commit
a399797982
4 changed files with 9 additions and 1 deletions
1
inc/dd.h
1
inc/dd.h
|
@ -109,6 +109,7 @@ typedef struct CNCDDRAW
|
|||
BOOL wine;
|
||||
BOOL altenter;
|
||||
BOOL hidecursor;
|
||||
HCURSOR old_cursor;
|
||||
BOOL accurate_timers;
|
||||
BOOL resizable;
|
||||
BOOL nonexclusive;
|
||||
|
|
|
@ -64,6 +64,8 @@ void mouse_lock()
|
|||
}
|
||||
else
|
||||
{
|
||||
real_SetCursor(g_ddraw->old_cursor);
|
||||
|
||||
if (g_ddraw->hidecursor)
|
||||
{
|
||||
g_ddraw->hidecursor = FALSE;
|
||||
|
@ -125,6 +127,8 @@ void mouse_unlock()
|
|||
}
|
||||
}
|
||||
|
||||
real_SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||
|
||||
real_ClipCursor(NULL);
|
||||
|
||||
real_SetCursorPos(
|
||||
|
|
|
@ -122,7 +122,7 @@ int WINAPI fake_ShowCursor(BOOL bShow)
|
|||
HCURSOR WINAPI fake_SetCursor(HCURSOR hCursor)
|
||||
{
|
||||
if (g_ddraw && !g_ddraw->handlemouse && (g_ddraw->locked || g_ddraw->devmode))
|
||||
return real_SetCursor(hCursor);
|
||||
return real_SetCursor(g_ddraw->old_cursor = hCursor);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,10 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
case HTCLIENT:
|
||||
if (!g_ddraw->locked)
|
||||
{
|
||||
real_SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue