Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Mac: Update mouse position on warp.

  • Loading branch information
jorgenpt committed Apr 24, 2013
1 parent 479b642 commit 06f0751b4a94aeddc421ad998b90968ef74d5209
Showing with 6 additions and 0 deletions.
  1. +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

0 comments on commit 06f0751

Please sign in to comment.