Re: Maintaining NSCursor outside of app window
Re: Maintaining NSCursor outside of app window
- Subject: Re: Maintaining NSCursor outside of app window
- From: Corbin Dunn <email@hidden>
- Date: Fri, 14 Jan 2011 09:36:42 -0800
On Jan 14, 2011, at 1:00 AM, Uli Kusterer wrote:
> On 14.01.2011, at 01:37, Corbin Dunn wrote:
>> - (void)draggedImage:(NSImage *)draggedImage movedTo:(NSPoint)screenPoint
>>
>> Then do something like this (after converting the screen point to window coords):
>>
>> NSPoint windowPoint = [[view window] mouseLocationOutsideOfEventStream];
>> NSPoint localPoint = [view convertPoint:windowPoint fromView:nil];
>
> The OS will be very disappointed if it hands you a screenPoint and you just completely ignore it and use mouseLocationOutsideOfEventStream instead.
Sorry; I had contrived the example from some bits of code I had around. It is probably better to use the screenPoint passed to you. There was a reason mouseLocationOutsideOfEventStream is used in the above code...but I forget what it is.
But, FWIW, the OS won't be disappointed if you do this. It is perfectly acceptable. Try dragging an item out of Finder's sidebar on 10.6. If you think performance is unacceptable, then please log a bug:
http://bugreporter.apple.com
--corbin
> Due to lag, CPU load etc. It sounds like a better idea to use the parameter.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden