aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2017-09-17 14:32:25 -0500
committerColin Snover2017-10-15 13:24:21 -0500
commitf6ab0e5c10921be55e719ba93f8b5b980d4439e7 (patch)
treec37525601286a34c13ea6408469a70d2bb6b9318
parent8b112f57a9b5d27f79cebb28fa14ed7761270795 (diff)
downloadscummvm-rg350-f6ab0e5c10921be55e719ba93f8b5b980d4439e7.tar.gz
scummvm-rg350-f6ab0e5c10921be55e719ba93f8b5b980d4439e7.tar.bz2
scummvm-rg350-f6ab0e5c10921be55e719ba93f8b5b980d4439e7.zip
SDL: Allow window size to be reset whenever launcher is visible
This ensures the window gets resized properly when a user changes the scaler options in the GUI. Simply unlocking the window size on a call to setGraphicsMode is not good enough, because the scaler mode can be changed by games during mode switches, and we don't want to reset the window size in that case.
-rw-r--r--backends/graphics/sdl/sdl-graphics.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 64ee9f7aa1..0e0a45a38f 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -231,11 +231,12 @@ bool SdlGraphicsManager::createOrUpdateWindow(int width, int height, const Uint3
}
// We only update the actual window when flags change (which usually means
- // fullscreen mode is entered/exited) or when updates are forced so that we
+ // fullscreen mode is entered/exited), when updates are forced so that we
// do not reset the window size whenever a game makes a call to change the
// size or pixel format of the internal game surface (since a user may have
- // resized the game window)
- if (!_window->getSDLWindow() || _lastFlags != flags || _allowWindowSizeReset) {
+ // resized the game window), or when the launcher is visible (since a user
+ // may change the scaler, which should reset the window size)
+ if (!_window->getSDLWindow() || _lastFlags != flags || _overlayVisible || _allowWindowSizeReset) {
if (_hintedWidth) {
width = _hintedWidth;
}