Thanks for the CGWaitForScreen tip. I hadn't seen those and will take a look.

Overriding drawRect on a top level view sounds promising also.

I had thought about overriding setNeedsDisplay on a top level view in the window, but it wasn't clear that would catch calls to child views.

On May 7, 2008, at 6:18 PM, Graham Cox wrote:

I asked much the same question a few days ago, the answer would appear to be, you can't get those rects until drawRect: time. But couldn't you send your remote update then anyway? While that would effectively synchronise your remote screen update to the event cycle of the first machine, I don't see why that would be a problem.

If you can work at the global screen level rather than view level, there is also CGWaitForScreenUpdateRects and CGWaitForScreenRefreshRects which need to be used from a secondary thread - my guess is these exist to support remote display type applications.

Alternatively you could override setNeedsDisplay: and setNeedsDisplayInRect: and gather the rects yourself. You'd need to handle all your own coalescing and calculation of the minimum resulting set of rects though.



G.

On 8 May 2008, at 7:26 am, Denis Bohm wrote:

I am trying to create a buffered window and get notified whenever areas are repainted so that I can also send those areas over the network to a custom remote bitmap display. I don't want to copy the complete buffered image on each update as that would be much too slow.

NSView has getRectsBeingDrawn which seems close. What I really want is to hook into the code that is computing those rects. I assume this is done in NSWindow displayIfNeeded. But I don't see where the damage rects are stored.

Or maybe NSWindow flushWindowIfNeeded would work. But I don't see how to get the rects that need to be copied to the screen.

Any ideas on how this could be done?

Denis
_______________________________________________

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/graham.cox%40bigpond.com

This email sent to [EMAIL PROTECTED]



_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to