Repository navigation
fix: show the menu bar's items in Menu bar items on macOS 27 - #373
Merged
Merged
Conversation
macOS 27 draws every menu bar item in MenuBarAgent. Apps no longer list their items, and MenuBarAgent's own list holds only macOS's items, each wrapped in a view without an identifier, so the row showed a few grey placeholders and missed every third-party item. Read the items from MenuBarAgent's windows, taking the display whose window resolves the most items, and unwrap each to the element that carries its identifier and press action. macOS's items stay under Control Centre, so their symbols and references such as com.apple.menuextra.wifi still match, and pressing one checks Control Centre's windows for its open panel. The Control Center widget looks in Control Centre's list, then MenuBarAgent's. Search draws its magnifying glass under Siri, which owns it on macOS 27. Each app's own list is still read on macOS 26 and earlier, and whenever MenuBarAgent's windows hold no items. Fixes #372
|
🎉 This PR is included in version 0.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On macOS 27.2 the Menu bar items row shows a few grey placeholders instead of the menu bar's items. Third-party items are missing, clicking a placeholder opens nothing, and the Control Center widget no longer finds its item. macOS 27 draws every item in MenuBarAgent: apps no longer list their items through Accessibility, and MenuBarAgent's own list holds only macOS's items, each wrapped in a view without an identifier or press action.
Fixes #372
Changes
foundMenuBarItems,menuBarAgentItems): read MenuBarAgent's windows, one per display. Each slot holds macOS'sAXMenuBarItemin a hosting view, or the owning app'sAXButton. Only the active display's window resolves app buttons, so take the window with the most items. Unwrap each slot to the element that carries the identifier and press action, and take an app button's owner from its pid.menuBarItemApp): macOS's items stay under Control Centre, so their symbols and references such as{"app": "com.apple.controlcenter", "item": "com.apple.menuextra.wifi"}(Choose which menu bar items show on the bar and which stay in Menu bar items #355) still match.pressUnlessOpenchecks Control Centre's windows for the open panel of a MenuBarAgent item, because Control Centre still owns the Control Center and Battery panels.openControlCenter()looks in Control Centre's list, then MenuBarAgent's.com.apple.campo) owns Search on macOS 27, so it gets the magnifying glass instead of Siri's icon.AXMenuBarItems.No configuration changes. The guide's description of the row still holds, so
docs/widgets.mdis unchanged.Testing
NativePresentationTestswith a fake Accessibility tree:main: on macOS 27, Clock opens Notification Center, which closes at once, and a third-party app's menu (Shottr) doesn't stay open after a press. macOS 27 no longer exposes apps' menus, so StableBar can't redraw them either.Screenshots: the row drawn offscreen from the live reader on the same Mac,
main(5005ae5) and this branch.main)Merging
One commit; any merge method keeps it.
Claude Opus 5.5 via Claude Code