From 779b97ee3fb94cd2c80118febd6b451d454a7c54 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Wed, 29 Nov 2017 21:01:47 +0100 Subject: SDL: Don't use the window size hint for fullscreen Prevents the opengl backend from changing mode when entering fullscreen for games with a window size hint. Fixes #10335. Closes gh-1074. --- backends/graphics/sdl/sdl-graphics.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'backends') diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 336b16a5a1..1e37310ca2 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -244,11 +244,14 @@ bool SdlGraphicsManager::createOrUpdateWindow(int width, int height, const Uint3 // 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; - } - if (_hintedHeight) { - height = _hintedHeight; + const bool fullscreen = (flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP)) != 0; + if (!fullscreen) { + if (_hintedWidth) { + width = _hintedWidth; + } + if (_hintedHeight) { + height = _hintedHeight; + } } if (!_window->createOrUpdateWindow(width, height, flags)) { -- cgit v1.2.3