Re: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling
Re: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling
- Subject: Re: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling
- From: Dave Keck <email@hidden>
- Date: Sat, 04 Aug 2012 13:43:18 -1000
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 (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