From b3fdebfdf70b89ce047e461c9f5633ac5d2d0cc0 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 31 Jul 2023 09:02:04 +0200 Subject: [PATCH] [client,sdl] position windows centered on monitor --- client/SDL/sdl_freerdp.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/SDL/sdl_freerdp.cpp b/client/SDL/sdl_freerdp.cpp index 7b6f8e243..28c3454fa 100644 --- a/client/SDL/sdl_freerdp.cpp +++ b/client/SDL/sdl_freerdp.cpp @@ -627,8 +627,8 @@ static BOOL sdl_create_windows(SdlContext* sdl) sdl_window_t window = {}; Uint32 flags = SDL_WINDOW_SHOWN; - Uint32 startupX = SDL_WINDOWPOS_UNDEFINED; - Uint32 startupY = SDL_WINDOWPOS_UNDEFINED; + Uint32 startupX = SDL_WINDOWPOS_CENTERED_DISPLAY(x); + Uint32 startupY = SDL_WINDOWPOS_CENTERED_DISPLAY(x); if (monitor->attributes.desktopScaleFactor > 100) { @@ -645,8 +645,6 @@ static BOOL sdl_create_windows(SdlContext* sdl) if (sdl->context()->settings->UseMultimon) { flags |= SDL_WINDOW_BORDERLESS; - startupX = monitor->x; - startupY = monitor->y; window.offset_x = 0 - startupX; window.offset_y = 0 - startupY; }