src/video/cocoa/SDL_cocoawindow.m
changeset 7113 7b4b596b3cfb
parent 7098 f4b2c6fb0258
child 7158 ff52fba70795
equal deleted inserted replaced
7112:a1a723edea64 7113:7b4b596b3cfb
   391             }
   391             }
   392 
   392 
   393             cgpoint.x = window->x + x;
   393             cgpoint.x = window->x + x;
   394             cgpoint.y = window->y + y;
   394             cgpoint.y = window->y + y;
   395 
   395 
   396             /* We have to disassociate the curosr & the mouse before issuing
   396             /* According to the docs, this was deprecated in 10.6, but it's still
   397              * this cursor warp, otherwise it gets limited to one update per
   397              * around. The substitute requires a CGEventSource, but I'm not entirely
   398              * 250ms, and looks very choppy.
   398              * sure how we'd procure the right one for this event.
   399              */
   399              */
   400             CGAssociateMouseAndMouseCursorPosition(NO);
   400             CGSetLocalEventsSuppressionInterval(0.0);
   401             CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
   401             CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
   402             CGAssociateMouseAndMouseCursorPosition(YES);
   402             CGSetLocalEventsSuppressionInterval(0.25);
   403         }
   403         }
   404     }
   404     }
   405     SDL_SendMouseMotion(window, 0, 0, x, y);
   405     SDL_SendMouseMotion(window, 0, 0, x, y);
   406 }
   406 }
   407 
   407