DXGL r643 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r642‎ | r643 | r644 >
Date:01:34, 21 January 2016
Author:admin
Status:new
Tags:
Comment:
Try to fix fullscreen window sizes from programs that override DXGL's window size (such as ZSNES) Fail - screen gets huge.
Modified paths:
  • /ddraw/hooks.c (modified) (history)

Diff [purge]

Index: ddraw/hooks.c
@@ -306,7 +306,7 @@
307307 {
308308 SetWindowLongPtrA(hWnd, GWL_EXSTYLE, exstyle & ~(WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE));
309309 SetWindowLongPtrA(hWnd, GWL_STYLE, (winstyle | WS_POPUP) & ~(WS_CAPTION | WS_THICKFRAME | WS_BORDER));
310 - SetWindowPos(hWnd, NULL, 0, 0, sizes[4], sizes[5], SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
 310+ SetWindowPos(hWnd, NULL, 0, 0, sizes[4], sizes[5], SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_FRAMECHANGED);
311311 }
312312 }
313313 break;
@@ -326,7 +326,7 @@
327327 {
328328 SetWindowLongPtrA(hWnd, GWL_EXSTYLE, exstyle & ~(WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE));
329329 SetWindowLongPtrA(hWnd, GWL_STYLE, winstyle & ~(WS_CAPTION | WS_THICKFRAME | WS_BORDER | WS_POPUP));
330 - SetWindowPos(hWnd, NULL, 0, 0, sizes[4], sizes[5], SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
 330+ SetWindowPos(hWnd, NULL, 0, 0, sizes[4], sizes[5], SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_FRAMECHANGED);
331331 }
332332 }
333333 break;
@@ -365,7 +365,6 @@
366366 {
367367 SetWindowLongPtrA(hWnd, GWL_EXSTYLE, exstyle | WS_EX_APPWINDOW);
368368 SetWindowLongPtrA(hWnd, GWL_STYLE, (winstyle | WS_OVERLAPPEDWINDOW) & ~WS_POPUP);
369 - SetWindowPos(hWnd, NULL, 0, 0, sizes[4], sizes[5], SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
370369 }
371370 }
372371 break;
@@ -381,6 +380,13 @@
382381 case WM_SIZE:
383382 if (wParam != SIZE_MINIMIZED)
384383 {
 384+ if (((dxglcfg.fullmode == 0) || (dxglcfg.fullmode == 1)) && lpDD7)
 385+ {
 386+ glDirectDraw7_GetSizes(lpDD7, sizes);
 387+ if ((LOWORD(lParam) == sizes[4]) && (HIWORD(lParam) == sizes[5])) break;
 388+ SetWindowPos(hWnd, NULL, 0, 0, sizes[4], sizes[5], SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER);
 389+ glDirectDraw7_SetWindowSize(lpDD7, sizes[4], sizes[5]);
 390+ }
385391 if (dxglcfg.fullmode == 3)
386392 {
387393 if (lpDD7) glDirectDraw7_SetWindowSize(lpDD7, LOWORD(lParam), HIWORD(lParam));