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.
This commit is contained in:
Colin Snover 2017-09-17 14:32:25 -05:00
parent 8b112f57a9
commit f6ab0e5c10

View File

@ -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;
}