Re: Best technology to use for overlays?
Re: Best technology to use for overlays?
- Subject: Re: Best technology to use for overlays?
- From: Michael Ash <email@hidden>
- Date: Fri, 24 Apr 2009 07:38:46 -0400
On Fri, Apr 24, 2009 at 7:27 AM, Chris Suter <email@hidden> wrote:
> Hi Daniel,
>
> On Fri, Apr 24, 2009 at 9:07 PM, Michael Ash <email@hidden> wrote:
>
>> If you want to use the same back-end as window compositing, why not
>> use actual window compositing? Create a borderless NSWindow, make it a
>> child window, and position it appropriately.
>
> In my opinion, you're better off having a view to display the overlays
> if you can get it to work. I've had difficulties getting child
> windows to work well: problems with flickering when resizing windows
> (due to the display of the windows not being automatically
> synchronised) and there's also a small timing window where you can
> place a child window in the wrong place (you have to position child
> windows with absolute screen coordinates but the Window Server could
> move the parent whilst you're doing that).
>
> These problems aren't insurmountable although to solve the second
> problem I had to use an undocumented API call. I had to use an overlay
> window because I was overlaying an OpenGL window and it needed to work
> pre Leopard.
If your overlay is known about in advance, the solution to the timing
window is easy: load and position it immediately, when you load the
parent window, even if you don't need it yet. You can fill it with
nothing so that it's invisible, but this way there's no opportunity
for the positions to desynchronize.
Mike
_______________________________________________
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