This really does sound like a coordinate system issue after all. It may be a bug, or it may be correct but surprising behavior, or it may be a gray area of expectation. It seems worth a bug report to try to find out.

Indeed, I'll file one with as clear a description of the scenario as I can muster and someone at Apple can presumably choose between those possibilities :-)

Is it "when the drag started", or is it when autoscroll last scrolled the view?

It is when the autoscroll scrolls the view. Dragging works fine so long as there's no change in the position of the underlying view (i.e. scrolling) during the drag operation. Until the scroll offset is changed all the mouseEntered, mouseExited events arrive and they're clearly coming from the right areas w.r.t. the placement of the tracking areas in relation to the mouse movements.

Or perhaps there's a slightly cleaner workaround: regenerate your tracking areas at every autoscroll, using whatever offset you find to be necessary to get the tracking areas to behave as if they're in the right place. At mouseUp, regenerate the tracking areas one more time without the fudge factor, if you did the fudgy thing during scrolling.


This is one of the first things I tried. From memory, the tracking areas were automatically requested when the mouse went up anyway, but in any case all the tracking returns to normal at this point (I have some mouse-over logic that suddenly starts working again at the right place as soon as the drag is complete).

...if you did the fudgy thing during scrolling


Mmm. I'm going to have to check with you what this "fudgy thing" actually is, in case I'm not doing something that is required (officially or conventionally) to make things work. Certainly, I was doing all my autoscroll during receipt of NSPeriodic events, at which point the view was requested to scroll and I attempted to refresh my tracking areas as mentioned - nothing more. I was expecting subsequent events to arrive with correct mouse positions relative to the view when transformed per usual from window to view coords. Is there some extra offset from the beginning of the drag, or some other 'fudge' I'm supposed to be mixing in to mouse locations while a drag operation is underway? My fix suggests otherwise, as I'm able to ascertain correct positions of items manually in mouseDragged with only the 'normal' transformation of window-to-view coords, but I'm curious as to what you mean about the fudge-factor.

Cheers

-- lwe



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to