From 7e50a92eb93860f2076dfbd2cbfdd62163a50e2d Mon Sep 17 00:00:00 2001 From: Max Roncace Date: Thu, 12 Oct 2023 20:00:39 -0400 Subject: [PATCH] [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 --- client/SDL/sdl_freerdp.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/SDL/sdl_freerdp.cpp b/client/SDL/sdl_freerdp.cpp index b2ea9d3b7..2b3deac2b 100644 --- a/client/SDL/sdl_freerdp.cpp +++ b/client/SDL/sdl_freerdp.cpp @@ -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(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); }