From 1b42675e52554b18501a3fe8184f9997b1cda32f Mon Sep 17 00:00:00 2001 From: Lothar Serra Mari Date: Sun, 22 Aug 2021 10:30:34 +0200 Subject: [PATCH] BACKENDS: OPENGLSDL: Limit window positioning workaround to Win32 It looks like other platforms are not affected by this, at least I wasn't able to reproduce the issue on Linux in any way. Since branching off to the next release is very soon and we are running out of time, I'm limiting this to Win32 in order to avoid unneccessary breakage by only fixing _really_ affected platforms. --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 024d422886a..12a62b4cc60 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -544,11 +544,13 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { handleResize(actualWidth, actualHeight); +#ifdef WIN32 // WORKAROUND: Prevent (nearly) offscreen positioning of the ScummVM window by forcefully // trigger a re-positioning event to center the window. if (!_wantsFullScreen && !(SDL_GetWindowFlags(_window->getSDLWindow()) & SDL_WINDOW_MAXIMIZED)) { SDL_SetWindowPosition(_window->getSDLWindow(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); } +#endif return true; #else // WORKAROUND: Working around infamous SDL bugs when switching