Skip to content

feat: open Control Center and the macOS menu bar's items from the bar - #311

Merged
Seb-GRAF merged 2 commits into
mainfrom
feat/control-center-widget
Oct 24, 2026
Merged

Seb-GRAF merged 2 commits into
mainfrom
feat/control-center-widget

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Problem

With the macOS menu bar hidden, its items, such as Wi-Fi, Control Center and third-party icons, are out of reach until the pointer reaches the top edge, and then the whole menu bar slides in over StableBar. There was also no way to keep it from appearing at all.

Closes #83. Closes #310.

Changes

Control Center and Menu bar items widgets (first commit, #83). #83 proposed drawing live images of each item, which needs Screen Recording. These widgets need only Accessibility.

  • controlCenter is a button that opens macOS Control Center. It acts on mouse down and does nothing while Control Center's panel is open, so the click that closes the panel doesn't reopen it.
  • menuBarItems is an ellipsis that opens a row of icons, one for each item in the macOS menu bar, in menu bar order. Each icon is its app's icon, or an SF Symbol for Battery, Clock, Control Center and Spotlight, and shows the item's name on hover. StableBar reads the items through Accessibility (kAXExtrasMenuBarAttribute), from every running app in parallel with a 100 ms timeout, so a hung app can't hold up the row. StableBar's own item is left out, because reading it off the main thread crashes.
  • An item with an ordinary menu opens that menu below its icon, built by the same code as App menus. The row's menus and tooltips go through WidgetPopup, as a second instance (BarStore.innerPopup), so they open, morph and close like the bar's popups. When a popup's anchor sits inside another popup, it attaches to that popup as a child window and records its anchor on the widget's presentation instead of replacing the bar's open popup.
  • An item that draws its own panel (Control Center, Battery, Clock) has to be on screen to respond to AXPress. StableBar sets the menu bar's alpha to 0 (CGSSetMenuBarInsetAndAlpha), reveals it on that display (SLSSetMenuBarVisibilityOverrideOnDisplay), presses the item, then lets the menu bar hide and restores the alpha once the item closes. Both are private window server calls.
  • Reading app menus, which App menus also uses:
    • Rows that draw their text in child views, as in CodexBar and Tailscale, take their title from those views.
    • Only an AXMenu child counts as a submenu.
    • Runs of dividers collapse into one.
  • Submenus keep 8 pt from the screen edge.

Always hide (second commit, #310): bar.hideMenuBar, under Settings → General → Native menu bar, keeps the menu bar's alpha at 0 while StableBar runs and sets it back to 1 on quit. It's off by default, so the menu bar still shows on hover.

Both widgets are in Add widget, the schema, the Accessibility permission list and docs/widgets.md. Always hide is in the schema, Settings search and docs/getting-started.md.

Testing

  • swift test:
    • All 294 XCTest tests pass.
    • Swift Testing passes 449 of 454. The other five are ci: skip betas of pushes that change only docs, CI or tests #309's unchangedApp… release tests, and the failure comes from this Mac, not the branch: Homebrew's git 2.51.1 prints a diff header despite git diff --quiet, so scripts/unchanged-app.sh gets output it doesn't expect. This branch doesn't touch that script or its tests.
  • Tried signed builds on a live bar on macOS 26.6.2 with one display:
    • Control Center, Battery and Clock open their own panels without the menu bar showing.
    • The CodexBar and Tailscale menus show their rows without stray dividers or chevrons.
    • Clicking the ellipsis or the Control Center button again closes what it opened.
  • Not checked:
    • The latest build, where the row's menus and tooltips moved to WidgetPopup: opening, morphing between icons, closing, and Escape.
    • Several displays.
    • Whether the alpha stays at 0 if StableBar crashes instead of quitting.
    • Whether, with Always hide on, the invisible menu bar still takes clicks at the top edge.

Screenshots to follow.

Merging

Merge commit, so both features reach the changelog.

Claude Opus 5.5 via Claude Code (T3 Code)

@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.8.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.

Keep the macOS menu bar hidden while StableBar runs Show menu bar extras in the bar

1 participant