I have a custom borderless NSWindow in the shape of a circle. To do this I use a custom NSView that draws a filled circle.
Mouse clicks on a transparent pixel inside the window's content rect go straight through the window to whatever application happens to be behind it. Clicks inside the filled circle are intercepted by my application. So far so good.
The problem is that with the following line the above behavior changes and all clicks inside the windows's content rect are intercepted, transparent pixel or not:
[circleView setWantsLayer:YES];
Is there a way to have clicks on transparent pixels of CALayer
instances go through the window/view/layer to the application behind it?
It's essentially the exact same problem as described below (only that the solution doesn't work in all cases, because it doesn't support animations):
http://www.cocoabuilder.com/archive/cocoa/235281-clicking-through-nsview-with-calayers.html