4

I'm building a status bar application that opens an NSWindow beneath it's status item when clicked, similar to the Dropbox app:

enter image description here

However, when I test it within a fullscreen app (such as Mail), the screen switches back to my main desktop screen and shows the window there, rather than overlaying the window over the fullscreen app, as dropbox does:

enter image description here

Is it possible to show an NSWindow dropdown from an NSStatusItem while in fullscreen mode of another app? I've seen other projects, like Vadim Shpakovski's Popup, but I'd really like the content to be in an actual NSWindow.

As an aside, I've also tried this with NSPopover rather than NSWindow, but that also had issues with fullscreen mode, as I mentioned in another question I posted.

EDIT:

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

window.collectionBehavior =
            NSWindowCollectionBehavior.MoveToActiveSpace | NSWindowCollectionBehavior.FullScreenAuxiliary
Community
  • 1
  • 1
Conor Taylor
  • 2,998
  • 7
  • 37
  • 69

1 Answers1

3

Set your window's collectionBehavior to include NSWindowCollectionBehaviorFullScreenAuxiliary. If it's defined in a NIB, you can configure this on the Attributes inspector, in the pop-up menu labeled Full Screen.

Ken Thomases
  • 88,520
  • 7
  • 116
  • 154
  • Thanks! Got it working with: `NSWindowCollectionBehavior.MoveToActiveSpace | NSWindowCollectionBehavior.FullScreenAuxiliary` – Conor Taylor May 02 '15 at 08:10
  • Ken is it something similar to https://stackoverflow.com/questions/47674502/nsstatusitems-menu-are-not-shown-in-full-screen-model-for-the-mac-os-10-13-1 ? – JamesWebbTelescopeAlien Mar 01 '18 at 01:52