I need to create non-opaque transparent window, with opaque subviews (call them surfaceView) inside. Each subview can contain thousands of subview (call them controlView). So structure must be something like this:
NSWindow (non-opaque)
- NSView (non-opaque) (Window contentview)
-- NSView (opaque) (SurfaceView)
--- NSView (opaque) (ControlView)
The problem is, that WindowServer become overload, when there are thousands of controlViews inside. It looks like any NSView in window become non-opaque. I can't understand what i have to do.
There is no overload of WindowServer if the NSWindow is not opaque. But i need non-opaque window. This case proves that opaque NSView can contain lot of subviews with well performance.
There is no overload if the NSWindow has stylemask [.titled, .resizable], window become transparent (It proves that the transparent window with good performance is possible), but mouse not works through transparent parts of window. Also NSWindow has rounded corners from private class NSThemeframe. This solution is very dirty, because it needs to reimplement mouse events and replace some methods from private class.
There is no overload if the surface are childWindows instead subviews. But in this case, surfaces are not clip by main window, miniaturize animation not works, and in fact the window is not actualy window.
I have tried different combination and manipulations with CAlayer, opaque and other, but it looks like a bug. It is definitely possible to get good performance, but i can't understand how. Any ideas?