瀏覽代碼

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 3 月之前
父節點
當前提交
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);