[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx: [279] branches/fusegl/fuse/ui/cocoa/cocoaui.
Brought to you by:
fredm
From: <fr...@us...> - 2007-01-02 12:20:18
|
Revision: 279 http://svn.sourceforge.net/fuse-for-macosx/?rev=279&view=rev Author: fredm Date: 2007-01-02 04:20:15 -0800 (Tue, 02 Jan 2007) Log Message: ----------- Don't muck about with saving and resoring cursor position, just lock it in place while grabbed. Modified Paths: -------------- branches/fusegl/fuse/ui/cocoa/cocoaui.m Modified: branches/fusegl/fuse/ui/cocoa/cocoaui.m =================================================================== --- branches/fusegl/fuse/ui/cocoa/cocoaui.m 2007-01-02 10:11:45 UTC (rev 278) +++ branches/fusegl/fuse/ui/cocoa/cocoaui.m 2007-01-02 12:20:15 UTC (rev 279) @@ -74,7 +74,8 @@ { if( startup ) return 0; - position = [NSEvent mouseLocation]; + /* Lock the mouse pointer at its current position */ + CGAssociateMouseAndMouseCursorPosition(false); [NSCursor hide]; @@ -88,13 +89,8 @@ { [[FuseController singleton] setAcceptsMouseMovedEvents:NO]; - /* This seems to be the only API to put the cursor back where it was when - we hid it. The CGSetLocalEventsSuppressionInterval is a magic workaround - to prevent the cursor freezing for a couple of seconds following the - warp */ - CGPoint pos; pos.x = position.x; pos.y = position.y; - CGSetLocalEventsSuppressionInterval(0.0); - CGWarpMouseCursorPosition(pos); + /* Unlock the mouse pointer */ + CGAssociateMouseAndMouseCursorPosition(true); [NSCursor unhide]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |