I have build a cocoa mac application which is a menubar app. When you click it, it opens a NSWindow.
The problem:
1. When I open the menubar app on Desktop1.
2. Then go to Desktop2 and open the app by clicking the menubar icon, the app opens, but the desktop moves back to Desktop1 !
It’s a rather tricky thing.
I appreciate your help !
Thanks
Try setting your window collection behavior to
NSWindowCollectionBehaviorCanJoinAllSpacesso that, well, it isn’t restrained to a single desktop.NSWindowCollectionBehaviorMoveToActiveSpaceshould also work, but is a little more finicky.