Skip to content

fix: show the menu bar's items in Menu bar items on macOS 27 - #373

Merged
M4n0x merged 1 commit into
mainfrom
fix/372-menu-bar-items-macos-27
Oct 28, 2026
Merged

M4n0x merged 1 commit into
mainfrom
fix/372-menu-bar-items-macos-27

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

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

  • Reading items (foundMenuBarItems, menuBarAgentItems): read MenuBarAgent's windows, one per display. Each slot holds macOS's AXMenuBarItem in a hosting view, or the owning app's AXButton. 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.
  • Owners (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.
  • Opening: pressUnlessOpen checks 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.
  • Search: Siri (com.apple.campo) owns Search on macOS 27, so it gets the magnifying glass instead of Siri's icon.
  • Older macOS: each app's own list is still read on macOS 26 and earlier, and whenever MenuBarAgent's windows hold no items. Unwrapping is a no-op there, since the list's children are already AXMenuBarItems.

No configuration changes. The guide's description of the row still holds, so docs/widgets.md is unchanged.

Testing

  • New tests in NativePresentationTests with a fake Accessibility tree:
    • the macOS 27 layout: an inactive display with placeholders, an active one with macOS's and two apps' items, an empty slot and the reveal shield;
    • the macOS 26 layout, with and without MenuBarAgent running, keeping identifiers and menus;
    • the macOS 27 fallback to MenuBarAgent's own list when its windows hold no items;
    • macOS's items listed under Control Centre.
  • Forcing MenuBarAgent-only reading makes 4 of these tests fail, so they guard the fallback.
  • The full suite passes locally (550 tests) on macOS 27.2.
  • Live on macOS 27.2 (26B123), with the menu bar hidden: the row lists all 19 items with no placeholder. Through Accessibility, the Control Center widget, Control Center, Battery and an app's own panel (Liip Timesheet) open.
  • Not checked: macOS 26 or earlier on a real Mac (CI runs the suite on macos-26).
  • Not fixed, also on 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.

Reported Before (main) After

Merging

One commit; any merge method keeps it.

Claude Opus 5.5 via Claude Code

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
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 28, 2026 14:30
@M4n0x
M4n0x enabled auto-merge October 28, 2026 14:42
@M4n0x
M4n0x merged commit 2e70249 into main Oct 28, 2026
10 of 12 checks passed
@M4n0x
M4n0x deleted the fix/372-menu-bar-items-macos-27 branch October 28, 2026 15:25
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Menu bar items shows blank icons and loses third-party items on macOS 27

1 participant