mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user