summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornikolas <nikolas@gnu.org>2020-06-18 03:53:06 -0400
committerGitHub <noreply@github.com>2020-06-18 08:53:06 +0100
commitc9aff698d037c8e29620a9666ed37425f75abf62 (patch)
treebb36202d9dffbe36c321f9b75174e6ec8885e0ee
parent208614343fa6f5f190ea821ab9a0b420c3e0d636 (diff)
downloadopenttd-c9aff698d037c8e29620a9666ed37425f75abf62.tar.xz
Fix #8104: Always add WINDOW_RESIZABLE flag to SDL2 (#8211)
This fixes a bug that can reproduced with these steps: * Start openttd in fullscreen mode * Turn off fullscreen mode * Try to resize the window. The window can't be resized.
-rw-r--r--src/video/sdl2_v.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp
index 0dff1af4c..c599de65e 100644
--- a/src/video/sdl2_v.cpp
+++ b/src/video/sdl2_v.cpp
@@ -258,12 +258,10 @@ bool VideoDriver_SDL::CreateMainSurface(uint w, uint h, bool resize)
seprintf(caption, lastof(caption), "OpenTTD %s", _openttd_revision);
if (_sdl_window == nullptr) {
- Uint32 flags = SDL_WINDOW_SHOWN;
+ Uint32 flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE;
if (_fullscreen) {
flags |= SDL_WINDOW_FULLSCREEN;
- } else {
- flags |= SDL_WINDOW_RESIZABLE;
}
_sdl_window = SDL_CreateWindow(