mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
window: fix setMode using stale minimum size information when applying the size.
fixes #2287
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user