fix d3d9 automatic cursor lock on alt+tab
This commit is contained in:
parent
bbf2b0db12
commit
42d13edb92
4 changed files with 16 additions and 1 deletions
2
ddraw.rc
2
ddraw.rc
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
11
src/main.c
11
src/main.c
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue