From 1b6c4f48aa74b1b193c25239c885d3b95bf173ac Mon Sep 17 00:00:00 2001 From: Lothar Serra Mari Date: Sat, 21 Aug 2021 21:39:30 +0200 Subject: [PATCH] BACKENDS: OPENGLSDL: Forcefully center the window to prevent off-screen rendering --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 985965a7308..29b3e00cb89 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -543,6 +543,10 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { getWindowSizeFromSdl(&actualWidth, &actualHeight); handleResize(actualWidth, actualHeight); + + // 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); return true; #else // WORKAROUND: Working around infamous SDL bugs when switching