diff options
author | Patric Stout <truebrain@openttd.org> | 2021-03-08 16:57:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-08 16:57:59 +0100 |
commit | 04db99749b6cb81f5df92e80fe0e731cb1eb9f12 (patch) | |
tree | 50a44241a9c937da96db04991bdf76f9bd5ece99 | |
parent | d3179709b1c848dfad61540cbea3db7ed8deb5fb (diff) | |
download | openttd-04db99749b6cb81f5df92e80fe0e731cb1eb9f12.tar.xz |
Fix #8784: using alt+enter didn't update the fullscreen toggle visibly (#8820)
Basically, the window was not invalidated, so it was never redrawn.
This made it look like it wasn't working, but it really was.
-rw-r--r-- | src/video/cocoa/cocoa_v.mm | 1 | ||||
-rw-r--r-- | src/video/sdl2_v.cpp | 1 | ||||
-rw-r--r-- | src/video/sdl_v.cpp | 1 | ||||
-rw-r--r-- | src/video/win32_v.cpp | 5 |
4 files changed, 7 insertions, 1 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 7b7fe9d67..1a75017df 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -201,6 +201,7 @@ bool VideoDriver_Cocoa::ToggleFullscreen(bool full_screen) [ NSMenu setMenuBarVisible:!full_screen ]; this->UpdateVideoModes(); + InvalidateWindowClassesData(WC_GAME_OPTIONS, 3); return true; } diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp index f122a2921..a1f896050 100644 --- a/src/video/sdl2_v.cpp +++ b/src/video/sdl2_v.cpp @@ -761,6 +761,7 @@ bool VideoDriver_SDL_Base::ToggleFullscreen(bool fullscreen) DEBUG(driver, 0, "SDL_SetWindowFullscreen() failed: %s", SDL_GetError()); } + InvalidateWindowClassesData(WC_GAME_OPTIONS, 3); return ret == 0; } diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index f9ec2a86c..8f7c26b89 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -763,6 +763,7 @@ bool VideoDriver_SDL::ToggleFullscreen(bool fullscreen) _fullscreen ^= true; } + InvalidateWindowClassesData(WC_GAME_OPTIONS, 3); return ret; } diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index ae1f5aafa..30729ead6 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -967,7 +967,10 @@ bool VideoDriver_Win32Base::ToggleFullscreen(bool full_screen) std::unique_lock<std::recursive_mutex> lock; if (this->draw_mutex != nullptr) lock = std::unique_lock<std::recursive_mutex>(*this->draw_mutex); - return this->MakeWindow(full_screen); + bool res = this->MakeWindow(full_screen); + + InvalidateWindowClassesData(WC_GAME_OPTIONS, 3); + return res; } void VideoDriver_Win32Base::AcquireBlitterLock() |