Commit 88e9f7765c71156eaa8651b0efa071a7a2f1f247

Sam Lantinga 2021-10-14T18:37:27

Fixed relative mouse mode using warping after https://github.com/libsdl-org/SDL/commit/82793ac279d19b5bde8fc2bd62877b05ba5a76e0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index a441965..1e8e50f 100644
--- a/src/events/SDL_mouse.c
+++ b/src/events/SDL_mouse.c
@@ -359,7 +359,11 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ
             return 0;
         }
         if (window && (window->flags & SDL_WINDOW_INPUT_FOCUS) != 0) {
-            SDL_WarpMouseInWindow(window, center_x, center_y);
+            if (mouse->WarpMouse) {
+                mouse->WarpMouse(window, center_x, center_y);
+            } else {
+                SDL_PrivateSendMouseMotion(window, mouseID, 0, center_x, center_y);
+            }
         }
     }