window: fix setMode using stale minimum size information when applying the size.

fixes #2287
This commit is contained in:
Sasha Szpakowski
2026-03-01 00:20:32 -04:00
parent 147d39251c
commit 035187b637
+4 -3
View File
@@ -576,6 +576,8 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
if (isOpen())
{
SDL_SetWindowMinimumSize(window, f.minwidth, f.minheight);
if (fsmode.w > 0 && fsmode.h > 0)
SDL_SetWindowFullscreenMode(window, &fsmode);
else
@@ -620,6 +622,8 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
if (!createWindowAndContext(x, y, width, height, createflags, renderer))
return false;
SDL_SetWindowMinimumSize(window, f.minwidth, f.minheight);
if (f.fullscreen)
{
if (fsmode.w > 0 && fsmode.h > 0)
@@ -640,9 +644,6 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
// Make sure the mouse keeps its previous grab setting.
setMouseGrab(mouseGrabbed);
// Enforce minimum window dimensions.
SDL_SetWindowMinimumSize(window, f.minwidth, f.minheight);
if (this->settings.displayindex != f.displayindex || f.useposition || f.centered)
SDL_SetWindowPosition(window, x, y);