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: Kyle Sluder <email@hidden>
- Date: Sat, 04 Aug 2012 16:57:44 -0700
On Aug 4, 2012, at 4:43 PM, Dave Keck <email@hidden> wrote:
> 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.
I'm unsure of the wisdom of this approach. Presumably the scroll view is intentionally blocking the runloop, and thus assuming that the runloop will not fire its event sources until after the scrolling is complete. By waking up the runloop, you're violating that assumption and could be causing work the scrollview has enqueued to be performed sooner than expected.
--Kyle Sluder
_______________________________________________
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