[client,sdl] position windows centered on monitor

This commit is contained in:
Armin Novak 2023-07-31 09:02:04 +02:00 committed by akallabeth
parent eca4017c8b
commit b3fdebfdf7
1 changed files with 2 additions and 4 deletions

View File

@ -627,8 +627,8 @@ static BOOL sdl_create_windows(SdlContext* sdl)
sdl_window_t window = {}; sdl_window_t window = {};
Uint32 flags = SDL_WINDOW_SHOWN; Uint32 flags = SDL_WINDOW_SHOWN;
Uint32 startupX = SDL_WINDOWPOS_UNDEFINED; Uint32 startupX = SDL_WINDOWPOS_CENTERED_DISPLAY(x);
Uint32 startupY = SDL_WINDOWPOS_UNDEFINED; Uint32 startupY = SDL_WINDOWPOS_CENTERED_DISPLAY(x);
if (monitor->attributes.desktopScaleFactor > 100) if (monitor->attributes.desktopScaleFactor > 100)
{ {
@ -645,8 +645,6 @@ static BOOL sdl_create_windows(SdlContext* sdl)
if (sdl->context()->settings->UseMultimon) if (sdl->context()->settings->UseMultimon)
{ {
flags |= SDL_WINDOW_BORDERLESS; flags |= SDL_WINDOW_BORDERLESS;
startupX = monitor->x;
startupY = monitor->y;
window.offset_x = 0 - startupX; window.offset_x = 0 - startupX;
window.offset_y = 0 - startupY; window.offset_y = 0 - startupY;
} }