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
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…
Add table
Add a link
Reference in a new issue