Show NSWindow under NSStatusItem in full screen mode

I am creating a status bar application that opens an NSWindow under its status on click, similar to the Dropbox application:

enter image description here

However, when I test it in a full screen app (like Mail), the screen switches back to the main desktop screen and shows the window there, rather than overlaying the window on the full screen app, as dropbox does:

enter image description here

Is it possible to show the NSWindow dropdown menu from an NSStatusItem while in full screen mode of another application? I've seen other projects like Vadim Shpakovski Popup , but I'd really like the content to be in a real NSWindow.

As an aside, I also tried this with NSPopover and not NSWindow, but this also had problems with fullscreen mode as I mentioned in another question I posted .

EDIT:

Using Ken's answer, I was able to get it to work with:

window.collectionBehavior =
            NSWindowCollectionBehavior.MoveToActiveSpace | NSWindowCollectionBehavior.FullScreenAuxiliary

      

+3


source to share


1 answer


Set the box collectionBehavior

to enable NSWindowCollectionBehaviorFullScreenAuxiliary

. If it is defined in the NIB, you can customize it in the Attribute inspector on the pop-up menu labeled Full Screen.



+2


source







All Articles