DXGL r639 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r638‎ | r639 | r640 >
Date:21:44, 16 January 2016
Author:admin
Status:new
Tags:
Comment:
Don't auto-minimize window in forced fullscreen mode.
Modified paths:
  • /ddraw/hooks.c (modified) (history)

Diff [purge]

Index: ddraw/hooks.c
@@ -19,8 +19,11 @@
2020 #include "hooks.h"
2121 #include <tlhelp32.h>
2222 #include "../minhook-1.3/include/MinHook.h"
23 -void glDirectDraw7_UnrestoreDisplayMode(LPDIRECTDRAW7 lpDD7); // temporary until glDirectDraw is converted to C
2423
 24+// temporary references to C++ C-linked stuff
 25+void glDirectDraw7_UnrestoreDisplayMode(LPDIRECTDRAW7 lpDD7);
 26+extern DXGLCFG dxglcfg;
 27+
2528 const TCHAR *wndprop = _T("DXGLWndProc");
2629 const TCHAR *wndpropdd7 = _T("DXGLWndDD7");
2730 static HWND_HOOK *hwndhooks = NULL;
@@ -265,14 +268,17 @@
266269 case WM_ACTIVATEAPP:
267270 if (!wParam)
268271 {
269 - ShowWindow(hWnd, SW_MINIMIZE);
270 - if (lpDD7) IDirectDraw7_SetDisplayMode(lpDD7, -1, -1, -1, -1, 0);
 272+ if (dxglcfg.fullmode < 2)
 273+ {
 274+ ShowWindow(hWnd, SW_MINIMIZE);
 275+ if (lpDD7) IDirectDraw7_SetDisplayMode(lpDD7, -1, -1, -1, -1, 0);
 276+ }
271277 }
272278 break;
273279 case WM_SYSCOMMAND:
274280 if (wParam == SC_RESTORE)
275281 {
276 - if (lpDD7) glDirectDraw7_UnrestoreDisplayMode(lpDD7);
 282+ if (lpDD7 && (dxglcfg.fullmode < 2)) glDirectDraw7_UnrestoreDisplayMode(lpDD7);
277283 }
278284 break;
279285 }