Show hidden items in a separate bar#358
Conversation
Add an opt-in preferences setting that displays hidden menu bar items in a dedicated panel below the menu bar. The implementation captures individual menu bar item windows, collapses the inline section again, masks the capture flash, and forwards clicks back to the source item when Accessibility permission is available. Document the Screen Recording and Accessibility permission requirements while preserving the existing inline behavior by default.
When the separator is command-dragged into an invalid position, the separate-bar path could return while the separator was still using the collapsed spacer length. Restore the inline menu bar instead so the separator reappears and the user can recover the layout.
Reject separate-bar captures when the separator is not on the active menu bar row, and fall back to inline expansion instead of cloning visible items near the arrow. Keep auto-collapse active for a visible separate panel and force the inline fallback through the normal expansion side effects for full-status mode.
Keep the separate-bar marker anchored to the captured separator location after the real menu bar is collapsed. Mask any captured hidden item that macOS still leaves visible in the menu bar so it stays in the detached panel instead of appearing twice. Refresh status-item geometry from the live status item before falling back to cached click data, preventing hotkey opens from using stale menu-bar positions. Refs: dwarvesf#357
Sample captured hidden item luminance before drawing the separate bar so light captured glyphs use a dark floating panel even when macOS appearance alone would choose a light background.
Let the capture shield settle before revealing hidden menu bar items for capture, and size it from the collapsed separator geometry so the full hidden section is covered instead of a fixed-width slice.
Temporarily restore the real separator width while the user Cmd-drags menu bar items so macOS still has a usable drop boundary when the separate hidden-items bar preference is enabled. Force the temporary drag state back to the collapsed width after mouse-up to avoid stretched separator menus or invalid status item ordering.
|
Linking this to the redesign epic #366. This PR is a concrete implementation of the 'separate bar' direction (Option D in the design notes), which is the architectural fix for the icon-order, always-hidden, notch, and macOS 27 hiding clusters at once. It will be evaluated as a foundation for that epic, not only as a standalone feature. Thanks for the substantial work here. |
|
@tieubao since this PR is anchoring #366 (Option D), here's what we've found digging into macOS 27's menu bar model from two angles,one on this PR's capture approach, one from the SPEC-003 diagnostic in #365. Both point at the same root cause. 1. Per-item window capture (this PR's approach)On macOS 27, individual status items are no longer independent CGS windows — their windowIDs are synthetic per-process hashes. What does still work: the menu bar host process renders all status items into one transparent hosting window, which can be captured and cropped per-item using AX-reported bounds ( 2. SPEC-003 hide-mechanism diagnostic (from #365)Ran the diagnostic from #365 on macOS 27. Output:
Both point the same direction: macOS 27 hands menu bar layout/compositing to MenuBarAgent, and APIs that used to work by manipulating CGS windows or NSStatusItem geometry no longer have the effect they used to — even when the call itself "succeeds" and reports the expected values. For #365's diagnostic specifically, this item's own length/window/button width probably isn't a reliable degrade signal; might need to check whether other status items' on-screen positions actually shift after collapse. For #366/Option D: if the separate-bar capture is meant to anchor the redesign, it's probably worth building the capture layer around AX bounds from the start rather than window IDs, so it survives macOS 27 without a rewrite. We're actively working through this in stonerl/Thaw#687. One promising lead so far is that BetterTouchTool's developer (fifafu) found a couple of potentially viable approaches for menu bar managers on the new macOS, both more limited than what existed before. They've shipped the first as an experiment in BTT 5.670 and are currently gathering feedback on whether it holds up across different machines. |
Summary
Implements #357 by adding an opt-in
Show hidden items in separate barpreference.When enabled, Hidden Bar keeps the main menu bar collapsed and shows captured hidden menu bar items in a separate panel below the menu bar on the current display. This gives hidden items their own row instead of relying on the system menu bar having enough horizontal space.
What changed
Cmd-drag configuration workflow working while the separate-bar preference is enabled.Notes
This is a clean-room AppKit implementation. Thaw/Ice were used only as user-facing behavior references; no GPL source was copied.
The new mode may require Screen Recording permission for capture and Accessibility permission for click forwarding.