Skip to content

Commit

Permalink
Cocoa: send a MOUSEMOTION event when warping cursor from outside the …
Browse files Browse the repository at this point in the history
…window.

Fixes Bugzilla #2984.
  • Loading branch information
icculus committed May 31, 2015
1 parent dbfd4fd commit 5b2ff76
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/video/cocoa/SDL_cocoamouse.m
Expand Up @@ -230,6 +230,10 @@ + (NSCursor *)invisibleCursor
static void
Cocoa_WarpMouse(SDL_Window * window, int x, int y)
{
/* pretend we have the mouse focus, even if we don't, so
Cocoa_WarpMouseGlobal() will properly fake a mouse motion event. */
SDL_Mouse *mouse = SDL_GetMouse();
mouse->focus = window;
Cocoa_WarpMouseGlobal(x + window->x, y + window->y);
}

Expand Down

0 comments on commit 5b2ff76

Please sign in to comment.