From 1a6de69da4da6cfb6403d8f715ad86128431e23f Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Wed, 3 Oct 2018 14:54:47 +0200 Subject: [PATCH] switch to windowed on minimize and go back to fullscreen exclusive on restore - makes alt+tab failsafe --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index c946b65..bf6b6e5 100644 --- a/src/main.c +++ b/src/main.c @@ -612,6 +612,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (!ddraw->windowed) { ChangeDisplaySettings(&ddraw->render.mode, CDS_FULLSCREEN); + + D3dpp.Windowed = FALSE; InterlockedExchange(&ddraw->resetDirect3D9, TRUE); if (wParam == WA_ACTIVE) @@ -632,6 +634,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { ShowWindow(ddraw->hWnd, SW_MINIMIZE); ChangeDisplaySettings(&ddraw->mode, 0); + + D3dpp.Windowed = TRUE; InterlockedExchange(&ddraw->resetDirect3D9, TRUE); } }