Make NSWindow truly the highest level (over mouse, over mission control / exposure)

I was wondering if you can make NSWindow show above absolutely everything. I current sets the window level in CGShieldingWindowLevel using code ...

[self setLevel:CGShieldingWindowLevel()]; 

... and this does a great job for the most part, but that is not enough. The window does not appear when mission control or exposure is active, and it is displayed under the mouse. I was wondering if it was possible to create a truly "upper level" that will be drawn on all these elements.

Any help would be greatly appreciated. Thank you

+8
objective-c nsview macos nswindow
source share
1 answer

As for your question about Expose, you probably just didn't configure your collection to behave correctly. Subclass NSWindow , and somewhere in your initialization do the following:

 self.collectionBehavior = (NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorIgnoresCycle); 

If you want your window in all spaces (which you are probably doing), be sure to also add NSWindowCollectionBehaviorCanJoinAllSpaces .

From the point of view of your mouse question, unfortunately, I donโ€™t think there is a way to draw over it.

+5
source share

All Articles