BACKENDS: OPENGLSDL: Forcefully center the window to prevent off-screen rendering

This commit is contained in:
Lothar Serra Mari 2021-08-21 21:39:30 +02:00 committed by Eugene Sandulenko
parent cedd57a4ac
commit 1b6c4f48aa

View File

@ -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