Skip to content
Permalink
Browse files
Cocoa: send a MOUSEMOTION event when warping cursor from outside the …
…window.

Fixes Bugzilla #2984.
  • Loading branch information
icculus committed May 31, 2015
1 parent dbfd4fd commit 5b2ff76c12af3663367996019c436ee116b221b8
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/video/cocoa/SDL_cocoamouse.m
@@ -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);
}

0 comments on commit 5b2ff76

Please sign in to comment.