Popover in full-screen apps doesn't keep menu bar open

I have an app that acts as an agent (no dock/app, just menu bar icon). When the icon is clicked, I show a popover with a small user interface.

This works great, however, there is an issue. When a certain app is in full-screen and then my menu bar icon is clicked, the user interface shows just fine, until the mouse is moved outside the menu bar - then the user interface stays but the menu bar dismisses and closes.

Is there a way to keep the menu bar open, like when clicking on Control Center, in full-screen apps?

This is how I open my popover:

        if let button = statusItem.button {
            if popover.isShown {
                self.popover.performClose(sender)
            } else {
                
                popover.show(relativeTo: button.bounds, of: button, preferredEdge: .minY)
                popover.contentViewController?.view.window?.makeKey()
            }
        }
    }

That seems like the default behaviour of NSPopover. They are usually closed in response to most user interactions expect the are tied to application-defined behaviors.

I can't speak on the implementation details of Control Center or how that works. However have you looked into NSPanel? An NSPanel behaves like a window but can float above other windows and stays open unless you explicitly close it,

@DTS Engineer Thanks for the reply.

I've already seen apps with similar behavior (popover with a menu bar icon) that do not dimiss the menu bar in full-screen. I wish to achieve the same behavior.

Popover in full-screen apps doesn't keep menu bar open
 
 
Q