fix: restore menu-bar hiding on macOS 27 (#360) - #382
Open
bhaveshnigam wants to merge 1 commit into
Open
Conversation
bhaveshnigam
force-pushed
the
bugfix/macos27-collapse-length
branch
2 times, most recently
from
August 16, 2026 10:20
16b9d4e to
5e7f3cf
Compare
macOS 27 discards a status item whose length reaches half the display width instead of clamping it, as macOS 26 and earlier did. The separator was inflated to twice the widest screen width, so on 27 it was dropped outright: it displaced no icons and its own glyph disappeared, which is the reported loss of hiding and the stray separator seen mid-menu-bar. Size the collapse length to just under half the width of the narrowest attached display. Below that cliff macOS 27 moves the icons the separator displaces into its own native overflow menu, so a partial-width separator still clears the bar, and the narrowest display is the only one whose cliff every bar's copy of the item clears. A bar clears only if the separator spans the distance from the icons to that overflow boundary. The distance grows with display width while the cliff is half of it, so beyond roughly 2800pt no length can hide: a 3840pt display needs ~2900pt and never accepts more than 1919pt. Displays of different widths therefore cannot both be served by one item: hiding on the narrowest shifts the wider ones' icons sideways. Default to leaving them alone (stay above every cliff, so macOS drops the item and no bar changes) and add hideWithMixedDisplays to opt into hiding instead. Hiding is unaffected with one display, or displays of equal width. Two alternatives were tried on hardware and rejected: keying the length on the pointer's display made the bars flicker between arrangements as the pointer moved, and spreading the length over several items does not work because macOS overflows the bar from the left, so the extra items fall into the overflow themselves and leave the real icons untouched. Also suppress the separator glyph while collapsed on macOS 27, where the item's span is on-screen rather than off it. macOS 26 and earlier keep the previous behavior. Measured on macOS 27.0 (26A5388g) by sweeping the length and photographing each display's menu bar in full: a 2056pt display hides at 600-1000pt and drops from 1028pt; a 3840pt display drops from 1920pt and hides at no length. The cliff is per item, so the always-hidden separator works alongside this.
bhaveshnigam
force-pushed
the
bugfix/macos27-collapse-length
branch
from
August 16, 2026 10:29
5e7f3cf to
428131b
Compare
4 tasks
ed-cheng-akqa
approved these changes
Aug 20, 2026
|
Is there likely to be a release of this fix, even if it only fixes it for those of us who don't use extra wide displays? |
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.


Fixes #360. Icon hiding stopped working entirely on macOS 27; this restores it using the existing mechanism, so there is no architectural change.
What's this PR do?
|glyph while collapsed on macOS 27+.#availablegated), including the existing widest-screen rule and 10,000pt bound.Root cause. macOS 27 discards a status item whose length reaches half the display width, where macOS 26 and earlier clamped it. Hidden Bar inflates the separator to
widestScreen * 2, which is over that limit on every Mac, so on 27 the separator was dropped outright: it displaced no icons and its own glyph vanished. That accounts for both symptoms reported in #360 — hiding doing nothing, and the stray separator some users see mid-menu-bar.Staying under the limit is sufficient to hide everything, because macOS 27 owns the overflow: once the separator fills the trailing region, the icons it displaces move into the system's native overflow menu (
«) rather than merely off-screen. The narrowest screen is used rather than the widest — the inverse of the pre-27 rule — because one length is applied to the item on every display's bar and the limit is per display, so a length sized for a wide screen would be over the limit on a narrow one and hide nothing anywhere.Measurements on macOS 27.0 (26A5388g), 2056pt display, by sweeping the separator length and capturing the
MenuBarAgentwindow at each step:The limit is per item, so the always-hidden separator can be inflated at the same time (verified with both sections enabled).
What are the relevant Git tickets?
Screenshots (if appropriate)
// attach the four PNGs from ~/Desktop/hiddenbar-360-screenshots/
Any background context you want to provide? (if appropriate)
Per CONTRIBUTING:
StatusBarController.swift,CHANGELOG.md,docs/ARCHITECTURE.md,docs/BACKLOG.md.#available-gated and take the original code path unchanged.Verification note for anyone reproducing this: the menu bar cannot be captured with a plain
screencapturewhen a fullscreen space covers it. Locate theMenuBarAgentwindow viaCGWindowListCopyWindowInfo([.optionAll])and capture it by ID (screencapture -x -o -l <id>), which works even when that window reportsonscreen=false. Comparing PNG byte sizes across states is a cheap hidden/visible signal.