Window visible on all spaces (including fullscreen apps)

Hello everyone!

I'm trying to make a window (NSWindow) visible on all the spaces including other full screen apps. I've been trying to set a higher window level as well as playing with expose and spaces settings in the inspector. I found some solutions on stackoverflow, but they do not work. At least on El Capitan.

Any ideas?

It should work to set the window's collectionBehavior to include NSWindowCollectionBehaviorCanJoinAllSpaces and NSWindowCollectionBehaviorFullScreenAuxiliary.

Unfortunately it's not. Here is a sample code:


let window = NSWindow(contentRect: NSRect(x: 300, y: 300, width: 200, height: 200), styleMask: NSBorderlessWindowMask, backing: .Buffered, `defer`: true)
window.backgroundColor = NSColor.greenColor()
window.makeKeyAndOrderFront(NSApp)
window.level = Int(CGWindowLevelForKey(.MaximumWindowLevelKey))
window.collectionBehavior = [.CanJoinAllSpaces, .FullScreenAuxiliary]

And what exactly is the behavior with that configuration? Also, I would recommend against using .MaximumWindowLevelKey. It should be sufficient to use .FloatingWindowLevelKey or .OverlayWindowLevelKey.

It displayes the window on all the spaces but it does not display the window over the fullscreen app windows.

I stumbled across this thread looking for a similar solution (How to stop LSUIElement app windows from hiding kittens?).


The code suggestion is wrong. The .FullScreenAuxiliary behavior is exactly the opposite of what I and the original poster are looking for. From the documentation for

NSWindowCollectionBehaviorFullScreenAuxiliary
(emphasis mine):


"Windows with this collection behavior can be shown on the same space as the fullscreen window."


How do I get !.FullScreenAuxiliary?


In other words, I want an NSWindow that appears in all spaces, but does not appear on top of full-screen apps/windows.

Window visible on all spaces (including fullscreen apps)
 
 
Q