Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Mac: Update mouse position on warp.
- Loading branch information
Showing
with
6 additions
and
0 deletions.
-
+6
−0
src/video/cocoa/SDL_cocoamouse.m
|
@@ -187,11 +187,17 @@ |
|
|
static void |
|
|
Cocoa_WarpMouse(SDL_Window * window, int x, int y) |
|
|
{ |
|
|
SDL_Mouse *mouse = SDL_GetMouse(); |
|
|
CGPoint point; |
|
|
|
|
|
point.x = (float)window->x + x; |
|
|
point.y = (float)window->y + y; |
|
|
CGWarpMouseCursorPosition(point); |
|
|
|
|
|
/* CGWarpMouseCursorPosition doesn't generate a window event, unlike our |
|
|
* other implementations' APIs. |
|
|
*/ |
|
|
SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 0, x, y); |
|
|
} |
|
|
|
|
|
static int |
|
|