BACKENDS: OPENGLSDL: Do not try to center window in fullscreen or maximized mode

This commit is contained in:
Lothar Serra Mari
2021-08-28 10:43:04 +02:00
committed by Eugene Sandulenko
parent 1b6c4f48aa
commit 4c7bc5effb
@@ -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