Commit de6963ea998d0ca939c0af9f5e0627b2a239c997

Sam Lantinga 2023-06-21T08:42:38

Apply DPI scale to mouse coordinates in SDL_WarpMouseInWindow() Fixes https://github.com/libsdl-org/SDL/issues/7855 (cherry picked from commit 657c346556f18044dac04957ee7894220e86ac8e)

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c
index 5943969..5844da7 100644
--- a/src/video/windows/SDL_windowsmouse.c
+++ b/src/video/windows/SDL_windowsmouse.c
@@ -288,6 +288,7 @@ static void WIN_WarpMouse(SDL_Window *window, int x, int y)
         return;
     }
 
+    WIN_ClientPointFromSDL(window, &x, &y);
     pt.x = x;
     pt.y = y;
     ClientToScreen(hwnd, &pt);