# HG changeset patch # User Ryan C. Gordon # Date 1326742067 18000 # Branch SDL-1.2 # Node ID 6f013dd0add1c6809aeab04e306892198a207616 # Parent f114f1434ff6071cd4829aaae399e87ec475a3cb Quartz: Fix mouse warping freezing for 250+ milliseconds. Fixes Bugzilla #1375. Thanks to Jeremiah Morris for the patch! diff --git a/src/video/quartz/SDL_QuartzWM.m b/src/video/quartz/SDL_QuartzWM.m --- a/src/video/quartz/SDL_QuartzWM.m +++ b/src/video/quartz/SDL_QuartzWM.m @@ -230,7 +230,6 @@ #endif /* Dead code */ void QZ_PrivateWarpCursor (_THIS, int x, int y) { - CGEventSourceRef evsrc = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState); NSPoint p; CGPoint cgp; @@ -238,9 +237,11 @@ cgp = QZ_PrivateSDLToCG (this, &p); /* this is the magic call that fixes cursor "freezing" after warp */ - CGEventSourceSetLocalEventsSuppressionInterval(evsrc, 0.0); + CGAssociateMouseAndMouseCursorPosition (0); CGWarpMouseCursorPosition (cgp); - CFRelease(evsrc); + if (grab_state != QZ_INVISIBLE_GRAB) { /* can't leave it disassociated? */ + CGAssociateMouseAndMouseCursorPosition (1); + } SDL_PrivateAppActive (QZ_IsMouseInWindow (this), SDL_APPMOUSEFOCUS); }