How MenuBarExtraAccess works with different styles
mainThe library supports both menu and window based styles, but they behave differently due to SwiftUI limitations:
.menuBarExtraStyle(.window)
- Provides access to the
NSWindowvia.introspectMenuBarExtraWindow. - Status items remain highlighted while the window is open, providing a native feel.
.menuBarExtraStyle(.menu)
- Known Limitation: When using the
.menustyle, SwiftUI causes the popup menu to block the runloop while open. - Consequences:
- Observing the
isPresentedbinding will not work as expected. - Setting
isPresentedtofalsewhile the menu is open has no effect. - The user must manually dismiss the menu to allow event flow to continue.
- Observing the