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.
This commit is contained in:
Lothar Serra Mari 2021-08-22 10:30:34 +02:00 committed by Eugene Sandulenko
parent 4c7bc5effb
commit 1b42675e52

View File

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