mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Fixed the minimum window size to re-set itself when love.window.setFullscreen(false) is called.
This commit is contained in:
@@ -551,14 +551,9 @@ void Window::updateSettings(const WindowSettings &newsettings)
|
|||||||
curMode.settings.fullscreen = love::android::getImmersive();
|
curMode.settings.fullscreen = love::android::getImmersive();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The min width/height is set to 0 internally in SDL when in fullscreen.
|
// SDL_GetWindowMinimumSize gives back 0,0 sometimes...
|
||||||
if (curMode.settings.fullscreen)
|
curMode.settings.minwidth = newsettings.minwidth;
|
||||||
{
|
curMode.settings.minheight = newsettings.minheight;
|
||||||
curMode.settings.minwidth = newsettings.minwidth;
|
|
||||||
curMode.settings.minheight = newsettings.minheight;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SDL_GetWindowMinimumSize(window, &curMode.settings.minwidth, &curMode.settings.minheight);
|
|
||||||
|
|
||||||
curMode.settings.resizable = (wflags & SDL_WINDOW_RESIZABLE) != 0;
|
curMode.settings.resizable = (wflags & SDL_WINDOW_RESIZABLE) != 0;
|
||||||
curMode.settings.borderless = (wflags & SDL_WINDOW_BORDERLESS) != 0;
|
curMode.settings.borderless = (wflags & SDL_WINDOW_BORDERLESS) != 0;
|
||||||
@@ -664,6 +659,10 @@ bool Window::setFullscreen(bool fullscreen, Window::FullscreenType fstype)
|
|||||||
SDL_GL_MakeCurrent(window, context);
|
SDL_GL_MakeCurrent(window, context);
|
||||||
updateSettings(newsettings);
|
updateSettings(newsettings);
|
||||||
|
|
||||||
|
// Apparently this gets un-set when we exit fullscreen (at least in OS X).
|
||||||
|
if (!fullscreen)
|
||||||
|
SDL_SetWindowMinimumSize(window, curMode.settings.minwidth, curMode.settings.minheight);
|
||||||
|
|
||||||
// Update the viewport size now instead of waiting for event polling.
|
// Update the viewport size now instead of waiting for event polling.
|
||||||
auto gfx = Module::getInstance<graphics::Graphics>(Module::M_GRAPHICS);
|
auto gfx = Module::getInstance<graphics::Graphics>(Module::M_GRAPHICS);
|
||||||
if (gfx != nullptr)
|
if (gfx != nullptr)
|
||||||
|
|||||||
Reference in New Issue
Block a user