Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make NSWindow truly the highest level (above mouse, above mission control/expose)

I was wondering if it is possible to make my NSWindow show above absolutely everything. I current set the window level to CGShieldingWindowLevel using the code...

[self setLevel:CGShieldingWindowLevel()];

...and this does a great job for the most part, but it isn't quite enough. The window is not drawn when mission control or expose is active, and it is drawn below the mouse. I was wondering if it was possible to crearte a truly "top level" which would be drawn above all these elements.

Any help would be greatly appreciated. Thanks!

like image 801
Atlas Wegman Avatar asked Jan 16 '13 02:01

Atlas Wegman


1 Answers

In regards to your question about Expose, you probably just haven't set your collection behavior correctly. Make a subclass of NSWindow, and somewhere in your initialization do something along the following:

self.collectionBehavior = (NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorIgnoresCycle);

If you want your window on all spaces (which you probably do) don't forget to also add NSWindowCollectionBehaviorCanJoinAllSpaces.

In terms of your question about the mouse, unfortunately I do not think there's a way to draw above it.

like image 147
sudo rm -rf Avatar answered Nov 16 '22 03:11

sudo rm -rf