Repository navigation
Description
What happens
The Apple menu and App menus stop opening. Their titles stay on the bar (Finder's here), but clicking them opens nothing. Clicking the desktop a few times brings them back, until it happens again a few seconds later.
Steps to reproduce
- Install Logitech G HUB. It starts
lghub_system_trayin every account from/Library/LaunchAgents/com.logi.ghub.plist, and the tray keeps reopening its background agent,com.logi.ghub.agent, through LaunchServices, which brings the agent to the front. - Show the Apple menu (
click: menu) and App menus on the bar, with Finder in front. - When the agent comes to the front, click the Apple logo or a menu title.
Without G HUB: run a small app with activation policy accessory that calls NSApp.activate(ignoringOtherApps: true). Any LSUIElement app that activates itself should do the same, such as a launcher.
Seen in a second, standard account, where the agent came to the front 44 times in 30 minutes; in the main account it did so twice.
Expected
The menus follow the app whose menus macOS shows. An agent that comes to the front has no menu bar, so macOS keeps the previous app's menus, and StableBar's should keep opening them.
Environment
- StableBar 0.11.0 (main at dc5a611 with diagnostic logging)
- macOS 27.2 (26B123)
- Logitech G HUB, installed for all accounts
- Standard test account, no window manager
Evidence
Diagnostic log in the test account while the agent was in front:
read com.logi.ghub.agent: failed items
openAppMenu Finder from app-menu
popup: item pid 34622 != app pid 35130
openAppMenu: no popup
Over one hour: 210 failed reads for com.logi.ghub.agent, 5 for com.apple.loginwindow, and 78 clicks that opened nothing. The system log shows launchservicesd SETFRONT: pid=35130 … oldFrontPid=34622 right after lghub_system_tray … LaunchServices.launchViaCSUA.
A probe app with activation policy accessory that activates itself: didActivateApplicationNotification fires and NSWorkspace.frontmostApplication is the probe, while NSWorkspace.menuBarOwningApplication stays on the previous app.
Diagnosis
On main at dc5a611:
Sources/StableBar/BarStore.swift:161-179:updateActiveAppruns on everydidActivateApplicationNotificationand reads the menus ofNSWorkspace.shared.frontmostApplication, whatever its activation policy.Sources/StableBar/AppMenu.swift:59-103:read(_:)stores that app. When its menu bar can't be read, the widgets keep the previous app's titles and retry (App menus and Apple menu intermittently disappear #120).Sources/StableBar/AppMenu.swift:109-114:popup(for:)opens a title only when its pid matches the stored app, so every kept title is refused while the agent is in front.
Proposed fix: read the menus of NSWorkspace.shared.menuBarOwningApplication, which is key-value observable, and read again when it changes, instead of following the frontmost app.
Related
- App menus and Apple menu intermittently disappear #120 kept the last menus and retried after short read failures. This is a different cause; that change is why the dead titles stay visible.
- Show the frontmost app's menus in the bar #82 and feat: show app menus in the bar #110 introduced the widgets.
Triaged by Claude Code (Claude Opus 5.5).
Activity
chore(release): 0.12.0 [skip ci]
stablebar-releases commentedon Nov 10, 2026
🎉 This issue has been resolved in version 0.12.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀