Hi Quincey,

> For the latter, it seems hardly surprising that the content wouldn't appear
> until you stop scrolling, since by setting the copy-on-scroll flag you've
> promised that the old view contents don't change during scrolling.

The docs don't say one way or another, but on both 10.7 and 10.8,
setNeedsDisplayInRect: is respected during scrolling when
copy-on-scroll is enabled -- that is, invalidated regions are redrawn
even if the regions were part of the copied region.

I'm afraid I sent my question before doing my due diligence though, so
in the interest of the archives: the reason the invalidated regions
weren't being redrawn during scrolling was because the block that
calls -setNeedsDisplayInRect: was scheduled to execute on the main
thread via dispatch_async(). Due to a change in either NSScrollView,
NSClipView, or CFRunLoop in 10.8, these blocks are only executed after
scrolling has stopped. Instead of dispatch_async(), one can use
CFRunLoopPerformBlock() along with CFRunLoopWakeUp() to have the block
executed on the main thread during scrolling.

Thanks for your suggestions Quincey,
David
_______________________________________________

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

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

Reply via email to