src/video/cocoa/SDL_cocoamouse.m
changeset 10122 f0645cd8fd39
parent 9998 f67cf37e9cd4
child 10159 d41acf6379f6
equal deleted inserted replaced
10121:6b6ded44e6e0 10122:f0645cd8fd39
   224     }
   224     }
   225     const CGPoint point = CGPointMake((float)x, (float)y);
   225     const CGPoint point = CGPointMake((float)x, (float)y);
   226 
   226 
   227     Cocoa_HandleMouseWarp(point.x, point.y);
   227     Cocoa_HandleMouseWarp(point.x, point.y);
   228 
   228 
   229     /* According to the docs, this was deprecated in 10.6, but it's still
       
   230      * around. The substitute requires a CGEventSource, but I'm not entirely
       
   231      * sure how we'd procure the right one for this event.
       
   232      */
       
   233     CGSetLocalEventsSuppressionInterval(0.0);
       
   234     CGWarpMouseCursorPosition(point);
   229     CGWarpMouseCursorPosition(point);
   235     CGSetLocalEventsSuppressionInterval(0.25);
   230 
       
   231     /* CGWarpMouse causes a short delay by default, which is preventable by
       
   232      * Calling this directly after. CGSetLocalEventsSuppressionInterval can also
       
   233      * prevent it, but it's deprecated as of OS X 10.6.
       
   234      */
       
   235     if (!mouse->relative_mode) {
       
   236         CGAssociateMouseAndMouseCursorPosition(YES);
       
   237     }
   236 
   238 
   237     /* CGWarpMouseCursorPosition doesn't generate a window event, unlike our
   239     /* CGWarpMouseCursorPosition doesn't generate a window event, unlike our
   238      * other implementations' APIs. Send what's appropriate.
   240      * other implementations' APIs. Send what's appropriate.
   239      */
   241      */
   240     if (!mouse->relative_mode) {
   242     if (!mouse->relative_mode) {