mirror of https://github.com/encounter/SDL.git
Mac: avoid calling CGSetLocalEventsSuppressionInterval, it was deprecated in OS X 10.6.
This commit is contained in:
parent
2c3bf6658a
commit
08488e6d34
|
@ -226,13 +226,15 @@ Cocoa_WarpMouseGlobal(int x, int y)
|
||||||
|
|
||||||
Cocoa_HandleMouseWarp(point.x, point.y);
|
Cocoa_HandleMouseWarp(point.x, point.y);
|
||||||
|
|
||||||
/* According to the docs, this was deprecated in 10.6, but it's still
|
|
||||||
* around. The substitute requires a CGEventSource, but I'm not entirely
|
|
||||||
* sure how we'd procure the right one for this event.
|
|
||||||
*/
|
|
||||||
CGSetLocalEventsSuppressionInterval(0.0);
|
|
||||||
CGWarpMouseCursorPosition(point);
|
CGWarpMouseCursorPosition(point);
|
||||||
CGSetLocalEventsSuppressionInterval(0.25);
|
|
||||||
|
/* CGWarpMouse causes a short delay by default, which is preventable by
|
||||||
|
* Calling this directly after. CGSetLocalEventsSuppressionInterval can also
|
||||||
|
* prevent it, but it's deprecated as of OS X 10.6.
|
||||||
|
*/
|
||||||
|
if (!mouse->relative_mode) {
|
||||||
|
CGAssociateMouseAndMouseCursorPosition(YES);
|
||||||
|
}
|
||||||
|
|
||||||
/* CGWarpMouseCursorPosition doesn't generate a window event, unlike our
|
/* CGWarpMouseCursorPosition doesn't generate a window event, unlike our
|
||||||
* other implementations' APIs. Send what's appropriate.
|
* other implementations' APIs. Send what's appropriate.
|
||||||
|
|
|
@ -115,9 +115,8 @@ Cocoa_MouseTapCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event
|
||||||
newLocation.y += (eventLocation.y - NSMaxY(windowRect) + 1);
|
newLocation.y += (eventLocation.y - NSMaxY(windowRect) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGSetLocalEventsSuppressionInterval(0);
|
|
||||||
CGWarpMouseCursorPosition(newLocation);
|
CGWarpMouseCursorPosition(newLocation);
|
||||||
CGSetLocalEventsSuppressionInterval(0.25);
|
CGAssociateMouseAndMouseCursorPosition(YES);
|
||||||
|
|
||||||
if ((CGEventMaskBit(type) & movementEventsMask) == 0) {
|
if ((CGEventMaskBit(type) & movementEventsMask) == 0) {
|
||||||
/* For click events, we just constrain the event to the window, so
|
/* For click events, we just constrain the event to the window, so
|
||||||
|
|
Loading…
Reference in New Issue