From 4c7bc5effbbdcf4c05375536ffe04ea13e5a33bb Mon Sep 17 00:00:00 2001 From: Lothar Serra Mari Date: Sat, 21 Aug 2021 21:59:51 +0200 Subject: [PATCH] BACKENDS: OPENGLSDL: Do not try to center window in fullscreen or maximized mode --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 29b3e00cb89..024d422886a 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -546,7 +546,9 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { // WORKAROUND: Prevent (nearly) offscreen positioning of the ScummVM window by forcefully // trigger a re-positioning event to center the window. - SDL_SetWindowPosition(_window->getSDLWindow(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); + if (!_wantsFullScreen && !(SDL_GetWindowFlags(_window->getSDLWindow()) & SDL_WINDOW_MAXIMIZED)) { + SDL_SetWindowPosition(_window->getSDLWindow(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); + } return true; #else // WORKAROUND: Working around infamous SDL bugs when switching