From 13a66d8c7203c8aab49428afb0f3984fca6ae3a4 Mon Sep 17 00:00:00 2001 From: ubkp <118854183+ubkp@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:40:13 -0300 Subject: [PATCH] Complement SetWindowMonitor SDL implementation 2 --- src/platforms/rcore_desktop_sdl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 993f43c37..02f8ae447 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -583,7 +583,7 @@ void SetWindowPosition(int x, int y) // Set monitor for the current window void SetWindowMonitor(int monitor) { - int monitorCount = SDL_GetNumVideoDisplays(); + const int monitorCount = SDL_GetNumVideoDisplays(); if ((monitor >= 0) && (monitor < monitorCount)) { if (CORE.Window.fullscreen) ToggleFullscreen(); @@ -607,6 +607,8 @@ void SetWindowMonitor(int monitor) // 3. It was't done here because we can't assume changing the window size automatically // is acceptable behavior by the user. SDL_SetWindowPosition(platform.window, usableBounds.x, usableBounds.y); + CORE.Window.position.x = x; + CORE.Window.position.y = y; } else {