Skip to content

[Experimental] Probe: what macOS 27 exposes for hiding menu-bar icons (#360/#366)#371

Draft
talkstream wants to merge 1 commit into
dwarvesf:developfrom
talkstream:feature/macos-27-menubar-probe
Draft

[Experimental] Probe: what macOS 27 exposes for hiding menu-bar icons (#360/#366)#371
talkstream wants to merge 1 commit into
dwarvesf:developfrom
talkstream:feature/macos-27-menubar-probe

Conversation

@talkstream

Copy link
Copy Markdown

Draft / exploration — does NOT hide anything. A read-only probe + findings to
scope a real macOS-27 hide mechanism for the managed-overflow epic (#366). No merge
expected; opened for the maintainer's evaluation. Companion to #370 (detect-and-degrade),
which is the correct shipping behavior on macOS 27 until such a mechanism is designed.

Why

#370 establishes that the length-inflation trick is dead on macOS 27 and degrades
gracefully. The obvious next question — can Hidden Bar actually hide icons on macOS 27,
and at what cost?
— is exactly what Option D / #366 ("managed-overflow, likely via
Accessibility") needs answered before any design. This PR is that recon, run on real
macOS 27 hardware (build 26A5368g).

experiments/macos27-menubar-probe.swift is a standalone, non-target tool (kept out
of the app build on purpose, so the sandboxed/MAS posture and #370 stay untouched). It
only reads state — it never moves, presses, hides, or modifies anything.

swiftc experiments/macos27-menubar-probe.swift -o /tmp/mbprobe && /tmp/mbprobe

Findings (macOS 27.0, 26A5368g)

  1. MenuBarAgent owns the bar; per-item windows are gone. The public
    CGWindowListCopyWindowInfo list shows a single full-width Window Server menu-bar
    window — none of the per-item status CGWindows the old trick (and window-capture
    tools) depended on.

  2. Accessibility still enumerates items + positions.
    AXUIElementCreateApplication(MenuBarAgent).AXExtrasMenuBar returns the 5 foreign
    status items with readable positions — but only with Accessibility permission
    (AXIsProcessTrusted), which the App Sandbox forbids.

  3. ...but there is no public lever to hide/move/reorder them.

    owner role / subrole AXPosition settable actions
    MenuBarAgent (modern) AXGroup / AXHostingView false none
    SystemUIServer (legacy) AXMenuBarItem / AXMenuExtra false AXPress, AXCancel

    The modern items are read-only SwiftUI hosting views: no settable position, no actions.

Conclusion

On macOS 27 public APIs let you read the menu bar but not rearrange it — there is no
public-API hide mechanism. Real hiding requires a private path (SkyLight/CGS* or the
MenuBarAgent interfaces that the maintained tools reverse-engineered), which needs
Accessibility (non-sandbox, not MAS-shippable as-is) and is explicitly at risk of Apple
changing/blocking it during the beta.

Suggested path (for #366)

Full write-up: docs/experiments/macos27-menubar.md. Re #360, #366.

…ons (dwarvesf#360)

Read-only Accessibility/CoreGraphics probe + findings, to scope a real macOS 27
hide mechanism for the managed-overflow epic (dwarvesf#366). It does NOT hide anything.

Findings on build 26A5368g:
- MenuBarAgent owns the status bar; per-item CGWindows are gone (the public
  window list shows one full-width menu-bar window).
- Accessibility (MenuBarAgent.AXExtrasMenuBar) still enumerates items and their
  positions, but the modern items are SwiftUI AXHostingView groups with no
  settable position and no actions -> no public hide/move/reorder primitive.
- Legacy SystemUIServer extras still expose AXPress but are not repositionable.

Conclusion: no public-API hide exists on macOS 27; real hiding needs a private
path (a la stonerl/Thaw), incompatible with the sandboxed/MAS build. This is a
standalone, non-target experiment kept out of the app build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant