1
votes

Long time lurker (found many an answer here!) and finally signed up with a question of my own.

I'm working on an VST audio plug-in and am having issues with the window passed to me by the host. The hierarchy is: NSWindow -> NSView -> NSView -> myNSViewSubclass, added with:

[parent addSubview:myNSView];

myNSViewSubclass is declared as opaque, as well as the parent NSView. However, the NSWindow keeps drawing its background into my space, despite being opaque. I've even set the NSWindow to not opaque.

I've tried a child window, but it also does the same thing. Any audio host I try exhibits the same behavior. Something has changed with NSWindow behavior and I am unable to find any setting to prevent the background from being drawn, or even a reason as to why it is ignoring its children's opacity.

I was on Mavericks and everything was working perfectly. So, to get ready to add the code for an AU version, I updated to Sierra and now have this issue.

Right now, my workaround is to just redraw the entire window, but while doable, this is quite expensive on the CPU.

Thanks!

1

1 Answers

0
votes

Not a solution to this issue, but a usable workaround. I just gave the NSWindow one pixel to handle with needsDisplayWithRect: and now I can continue to just update the rects that I have marked as dirty.

I also had to catch the special case when the entire window needs to be redrawn, such as when the window loses focus.

It's a couple of percent CPU more than what I originally had, but still within the limits I set.

Still would love to get the proper NSWindow behavior back, though.