[Scummvm-git-logs] scummvm master -> f8902028ef457426ad526146dc783916214c24a5
sev-
noreply at scummvm.org
Sun Apr 5 22:25:54 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
9bbe510a43 SDL: Change window size after switching off the fullscreen
f8902028ef SDL: Don't try to avoid downscaling on 3D with arbitrary resolution
Commit: 9bbe510a437aadbc8c4b40ea8db4b25c65764de5
https://github.com/scummvm/scummvm/commit/9bbe510a437aadbc8c4b40ea8db4b25c65764de5
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-04-06T00:25:49+02:00
Commit Message:
SDL: Change window size after switching off the fullscreen
But still switch to fullscreen after setting it up.
This avoids changing the window size in fullscreen which does not make
sense.
Changed paths:
backends/platform/sdl/sdl-window.cpp
diff --git a/backends/platform/sdl/sdl-window.cpp b/backends/platform/sdl/sdl-window.cpp
index e19925412af..4f44c492f3c 100644
--- a/backends/platform/sdl/sdl-window.cpp
+++ b/backends/platform/sdl/sdl-window.cpp
@@ -536,7 +536,9 @@ bool SdlWindow::createOrUpdateWindow(int width, int height, uint32 flags) {
fullscreenMode.refresh_rate = 0;
SDL_SetWindowDisplayMode(_window, &fullscreenMode);
#endif
+ SDL_SetWindowFullscreen(_window, fullscreenFlags);
} else {
+ SDL_SetWindowFullscreen(_window, fullscreenFlags);
SDL_SetWindowSize(_window, width, height);
if (flags & SDL_WINDOW_MAXIMIZED) {
SDL_MaximizeWindow(_window);
@@ -544,8 +546,6 @@ bool SdlWindow::createOrUpdateWindow(int width, int height, uint32 flags) {
SDL_RestoreWindow(_window);
}
}
-
- SDL_SetWindowFullscreen(_window, fullscreenFlags);
}
#if SDL_VERSION_ATLEAST(3, 0, 0)
@@ -571,22 +571,6 @@ bool SdlWindow::createOrUpdateWindow(int width, int height, uint32 flags) {
}
#endif
-#if defined(MACOSX)
- // macOS windows with the flag SDL_WINDOW_FULLSCREEN_DESKTOP exiting their fullscreen space
- // ignore the size set by SDL_SetWindowSize while they were in fullscreen mode.
- // Instead, they revert back to their previous windowed mode size.
- // This is a bug in SDL2: https://github.com/libsdl-org/SDL/issues/2518.
- // TODO: Remove the call to SDL_SetWindowSize below once the SDL bug is fixed.
-
- // In some cases at this point there may be a pending SDL resize event with the old size.
- // This happens for example if we destroyed the window, or when switching between windowed
- // and fullscreen modes. If we changed the window size here, this pending event will have the
- // old (and incorrect) size. To avoid any issue we call SDL_SetWindowSize() to generate another
- // resize event (SDL_WINDOWEVENT_SIZE_CHANGED) so that the last resize event we receive has
- // the correct size. This fixes for exmample bug #9971: SDL2: Fullscreen to RTL launcher resolution
- SDL_SetWindowSize(_window, width, height);
-#endif
-
_lastFlags = flags;
return true;
Commit: f8902028ef457426ad526146dc783916214c24a5
https://github.com/scummvm/scummvm/commit/f8902028ef457426ad526146dc783916214c24a5
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-04-06T00:25:49+02:00
Commit Message:
SDL: Don't try to avoid downscaling on 3D with arbitrary resolution
Fix #16253
Changed paths:
backends/graphics/openglsdl/openglsdl-graphics.cpp
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 037b05b7bc5..8b85804bf3e 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -33,6 +33,7 @@
#ifdef USE_OSD
#include "common/translation.h"
#endif
+#include "engines/engine.h"
#if SDL_VERSION_ATLEAST(3, 0, 0)
static void sdlGLDestroyContext(SDL_GLContext context) {
@@ -516,9 +517,13 @@ bool OpenGLSdlGraphicsManager::loadVideoMode(uint requestedWidth, uint requested
// In order to prevent any unnecessary downscaling (e.g. when launching
// a game in 800x600 while having a smaller screen size stored in the configuration file),
// we override the window dimensions with the "real" resolution request made by the engine.
- if ((requestedWidth < _lastRequestedWidth * _graphicsScale || requestedHeight < _lastRequestedHeight * _graphicsScale) && ConfMan.getActiveDomain()) {
- requestedWidth = _lastRequestedWidth * _graphicsScale;
- requestedHeight = _lastRequestedHeight * _graphicsScale;
+ // If it's the launcher or a 3D game supporting arbitrary resolutions, leave it as is
+ // as there is no downscale
+ const bool engineSupportsArbitraryResolutions = !g_engine ||
+ (_renderer3d && g_engine->hasFeature(Engine::kSupportsArbitraryResolutions));
+ if (!engineSupportsArbitraryResolutions) {
+ requestedWidth = MAX<uint>(requestedWidth, _lastRequestedWidth * _graphicsScale);
+ requestedHeight = MAX<uint>(requestedHeight, _lastRequestedHeight * _graphicsScale);
}
// Set allowed dimensions
More information about the Scummvm-git-logs
mailing list