1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

fix d3d9 automatic cursor lock on alt+tab

This commit is contained in:
FunkyFr3sh 2018-10-09 09:16:00 +02:00
parent bbf2b0db12
commit 42d13edb92
4 changed files with 16 additions and 1 deletions

View File

@ -2,7 +2,7 @@
#define vxstr(a,b,c,d) str(a##.##b##.##c##.##d)
#define str(s) #s
#define VERSION 1,2,0,5
#define VERSION 1,2,0,6
1 VERSIONINFO
FILEVERSION VERSION

View File

@ -26,6 +26,7 @@
#define WM_AUTORENDERER WM_USER+111
#define WM_WINEFULLSCREEN WM_USER+112
#define WM_D3D9FULLSCREEN WM_USER+113
extern BOOL ShowDriverWarning;

View File

@ -570,6 +570,17 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch(uMsg)
{
case WM_D3D9FULLSCREEN:
{
if (!ddraw->windowed)
{
if (GetSystemMetrics(SM_CYSCREEN) == ddraw->render.mode.dmPelsHeight &&
GetSystemMetrics(SM_CXSCREEN) == ddraw->render.mode.dmPelsWidth &&
GetForegroundWindow() == ddraw->hWnd)
mouse_lock();
}
break;
}
case WM_WINDOWPOSCHANGED:
{
WINDOWPOS *pos = (WINDOWPOS *)lParam;

View File

@ -242,7 +242,10 @@ static void Render()
Sleep(500);
if (!InterlockedExchangeAdd(&ddraw->minimized, 0) && CreateDirect3D())
{
active = TRUE;
PostMessage(ddraw->hWnd, WM_D3D9FULLSCREEN, 0, 0);
}
continue;
}