mirror of
https://github.com/love2d/love.git
synced 2026-08-21 13:09:56 +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())
|
if (isOpen())
|
||||||
{
|
{
|
||||||
|
SDL_SetWindowMinimumSize(window, f.minwidth, f.minheight);
|
||||||
|
|
||||||
if (fsmode.w > 0 && fsmode.h > 0)
|
if (fsmode.w > 0 && fsmode.h > 0)
|
||||||
SDL_SetWindowFullscreenMode(window, &fsmode);
|
SDL_SetWindowFullscreenMode(window, &fsmode);
|
||||||
else
|
else
|
||||||
@@ -620,6 +622,8 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
|||||||
if (!createWindowAndContext(x, y, width, height, createflags, renderer))
|
if (!createWindowAndContext(x, y, width, height, createflags, renderer))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
SDL_SetWindowMinimumSize(window, f.minwidth, f.minheight);
|
||||||
|
|
||||||
if (f.fullscreen)
|
if (f.fullscreen)
|
||||||
{
|
{
|
||||||
if (fsmode.w > 0 && fsmode.h > 0)
|
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.
|
// Make sure the mouse keeps its previous grab setting.
|
||||||
setMouseGrab(mouseGrabbed);
|
setMouseGrab(mouseGrabbed);
|
||||||
|
|
||||||
// Enforce minimum window dimensions.
|
|
||||||
SDL_SetWindowMinimumSize(window, f.minwidth, f.minheight);
|
|
||||||
|
|
||||||
if (this->settings.displayindex != f.displayindex || f.useposition || f.centered)
|
if (this->settings.displayindex != f.displayindex || f.useposition || f.centered)
|
||||||
SDL_SetWindowPosition(window, x, y);
|
SDL_SetWindowPosition(window, x, y);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user