Prevent status bar NSPopover from activating main window
Asked Answered
F

0

9

I'm implementing an NSPopover and having it appear in the status bar by setting it as a custom view. I've set its behavior to Transient, and also added a global event monitor so that when any other application gets focus, the NSPopover goes away.

This is working fairly well but the only problem I'm running into is that click on the popover brings to focus the main window of the application. If I put the window on one space and view the popover on another space and interact with the popover, I get thrown back to the space with the main window and it gets focused. Is there a way to prevent this? Perhaps allow interaction with the popover without activating the application?

Finis answered 24/2, 2014 at 21:7 Comment(1)
You could try setting your main window or the positioningWindow of the NSPopover to have the NSWindowCollectionBehaviorCanJoinAllSpaces collection behavior. This would at least eliminate the space-switching problem. As for the app activation issue, you might need to make your popover window have the NSBorderlessWindowMask.Cockup

© 2022 - 2024 — McMap. All rights reserved.