diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m index fd76bb584..58b666f03 100644 --- a/src/video/cocoa/SDL_cocoamouse.m +++ b/src/video/cocoa/SDL_cocoamouse.m @@ -224,10 +224,12 @@ Cocoa_WarpMouse(SDL_Window * window, int x, int y) CGWarpMouseCursorPosition(point); CGSetLocalEventsSuppressionInterval(0.25); - /* CGWarpMouseCursorPosition doesn't generate a window event, unlike our - * other implementations' APIs. - */ - SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 0, x, y); + if (!mouse->relative_mode) { + /* CGWarpMouseCursorPosition doesn't generate a window event, unlike our + * other implementations' APIs. + */ + SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 0, x, y); + } } static int diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 06f0fd28e..a3053075e 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -240,12 +240,13 @@ static __inline__ void ConvertNSRect(NSRect *r) - (void)windowDidBecomeKey:(NSNotification *)aNotification { SDL_Window *window = _data->window; + SDL_Mouse *mouse = SDL_GetMouse(); /* We're going to get keyboard events, since we're key. */ SDL_SetKeyboardFocus(window); /* If we just gained focus we need the updated mouse position */ - { + if (!mouse->relative_mode) { NSPoint point; int x, y;