Skip to content

fix: keep clicks on the bar from showing the menu bar on macOS 27 - #369

Merged
M4n0x merged 1 commit into
mainfrom
fix/366-notch-strip-clicks
Oct 28, 2026
Merged

M4n0x merged 1 commit into
mainfrom
fix/366-notch-strip-clicks

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Problem

On macOS 27, with the menu bar hiding automatically, clicks on the bar on a display with a notch show the macOS menu bar, and the click never reaches the widget. Fixes #366.

macOS 27's new MenuBarAgent covers the hidden menu bar's area on such a display with an invisible strip at window level 25. The bar sits at level 3, under it. MenuBarAgent takes the click and reveals the menu bar; its log says shownBy: "stripTap". Displays without a notch have no strip.

Changes

  • New MenuBarStrip (Sources/StableBar/MenuBarStrip.swift) raises a display's bar to level 26 while MenuBarAgent's strip covers that display's top and the menu bar is hidden. While macOS shows the menu bar, the bar goes back to .floating, so a menu bar revealed from the top edge, the keyboard or a client still draws over it.
  • MenuBarStripState reads that from the window list: a full-width MenuBarAgent window at the status level or above, at the display's top, means a strip. Any visible window at the main menu level there means the menu bar shows. These are owners, levels and bounds only; no Screen Recording needed.
  • The window list costs about 1.2 ms, so it is read only when needed:
    • after the bars update, and when the pointer enters a bar;
    • at 30 Hz while the pointer is within 5 points of the top edge or the menu bar shows;
    • every 2 s otherwise, and only while a display has a strip, to notice auto-hide turned off or the menu bar shown from the keyboard.
  • BarPanel keeps its decoration window at the bar's level. The strip update runs before the edit controls, which copy the bar's level.
  • The guide's Hide the native menu bar section says what happens on macOS 27.

Displays without a strip, and macOS before 27, keep the bar at .floating.

Testing

  • swift test --filter "menuBarStrip|menuBarDelay|BarDecoration|BarEditControls|PopupClick": all pass. Four new tests cover the strip on one display only, a menu bar shown or sliding versus hidden, other status-level windows, and the 5-point band.
  • Live on macOS 27.2: MacBook Pro built-in display plus an external display, auto-hide on, a scratch bar at the top edge.
    • 7 clicks on two script widgets, 5 of them on the built-in display, all ran their onClick. MenuBarAgent logged no stripTap reveal.
    • Pushing to the top edge revealed the menu bar 4 times (mouseEdge). The bar dropped to level 3 within one or two samples (about 15–30 ms) of the menu bar starting to slide in, and the menu bar showed over it.
    • The bar returned to level 26 within about 50 ms of the menu bar finishing hiding, and the next clicks worked.
    • The external display's bar stayed at level 3.
  • Before the fix, two throwaway panels in the strip showed the cause: at level 3 the click never arrived and the menu bar revealed (stripTap); at level 26 both clicks arrived with no reveal.
  • Not checked: MenuBarAgent's other notch UI, such as Live Activities or the camera indicator, which may sit under a raised bar. None appeared during testing; only the strip and the two hidden menu bars are MenuBarAgent windows here.
  • The behavior change is in click delivery and window level, so there are no before/after screenshots.

Merging

One fix commit. Squash merge with the title is fine. #368 fixes the reveal delay, the other macOS 27 regression from the same investigation, and doesn't depend on this one.

Claude Opus 5.5 via Claude Code.

On a display with a notch, macOS 27 covers the hidden menu bar's area
with an invisible strip above the bar, and a click on it shows the menu
bar instead of reaching the bar. Keep the bar above the strip while the
menu bar is hidden, and under the menu bar while macOS shows it.

Closes #366
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 28, 2026 11:12
@M4n0x
M4n0x merged commit 5005ae5 into main Oct 28, 2026
8 checks passed
@M4n0x
M4n0x deleted the fix/366-notch-strip-clicks branch October 28, 2026 11:57
@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.

Clicks on the bar show the macOS menu bar on notched displays in macOS 27

1 participant