Conversation
Toggle NSApp activation policy based on main window visibility so the app draws a proper menu bar while its window is shown, preventing the system status bar from disappearing after switching between Spaces in an LSUIElement (accessory) app. Show/hide now switches between .regular and .accessory on macOS.
|
Converted to draft as there are still some issue on Windows due to this fix. |
|
Actually the fix has no effect on other OSs except extra emty bundles. Meanwhile I found that in workflow config |
Problem
On macOS, the app runs as a tray-resident agent. After the main window is shown, switching to another desktop (Space) and back makes the entire system top menu bar / status bar (Apple menu, clock, battery, etc.) disappear, leaving blank space until the app loses focus.
Root cause
Fix
Keep the app's activation policy consistent with main-window visibility, so the app is .regular whenever its window is shown:
Known tradeoff
A Dock icon is visible while the main window is shown and disappears when the window is hidden to the tray. So if it was a designed behaviour, this fix may not be proper.