Преглед изворни кода

win32: Use the nearest monitor size for calculating maximized window dimensions

Default to using the nearest monitor, instead of null, as a null monitor can be sent when restoring from minimized, which results in the restored, maximized window being the wrong size.
Frank Praznik пре 7 месеци
родитељ
комит
bc448fa445
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/video/windows/SDL_windowsevents.c

+ 1 - 1
src/video/windows/SDL_windowsevents.c

@@ -1879,7 +1879,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
             WINDOWPLACEMENT placement;
             if (GetWindowPlacement(hwnd, &placement) && placement.showCmd == SW_MAXIMIZE) {
                 // Maximized borderless windows should use the monitor work area.
-                HMONITOR hMonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL);
+                HMONITOR hMonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
                 if (hMonitor) {
                     MONITORINFO info;
                     SDL_zero(info);