[client,sdl] Fix stored window offset for multimon

SDL_WINDOWPOS_CENTERED_DISPLAY returns a magic value which causes issues
when it's eventually passed to SDL_BlitSurface.

Fixes #9441
This commit is contained in:
Max Roncace 2023-10-12 20:00:39 -04:00 committed by akallabeth
parent 138d3df028
commit 7e50a92eb9

View File

@ -644,8 +644,6 @@ static BOOL sdl_create_windows(SdlContext* sdl)
if (settings->UseMultimon)
{
flags |= SDL_WINDOW_BORDERLESS;
window.offset_x = 0 - startupX;
window.offset_y = 0 - startupY;
}
else
{
@ -657,6 +655,16 @@ static BOOL sdl_create_windows(SdlContext* sdl)
static_cast<int>(h), flags);
if (!window.window)
goto fail;
if (settings->UseMultimon)
{
int win_x;
int win_y;
SDL_GetWindowPosition(window.window, &win_x, &win_y);
window.offset_x = 0 - win_x;
window.offset_y = 0 - win_y;
}
sdl->windows.push_back(window);
}