Skip to content

fix(fullbar): wait for the pointer to leave a self-hiding menu bar before deactivating - #608

Open
DragonNameLeo wants to merge 1 commit into
consolelabs:developfrom
DragonNameLeo:fix/fullbar-autohide-bounce
Open

DragonNameLeo wants to merge 1 commit into
consolelabs:developfrom
DragonNameLeo:fix/fullbar-autohide-bounce

Conversation

@DragonNameLeo

Copy link
Copy Markdown

What and why

This happens when "Make room for icons while they are shown" is on and the macOS menu bar is set to hide by itself. A click on the arrow to collapse hands focus back to the previous app while the pointer is still in the bar. macOS then starts hiding the menu bar (it slides up) and brings it straight back down. It happens on most collapses.

After this change, the collapse keeps Hidden Bar active until the pointer leaves the bar, for at most 10 s. Once the pointer has left, the bar hides anyway, so the app switch is not seen.

  • A menu bar that stays on screen deactivates at once, as before. A bar that hides by itself is detected because the screen's visibleFrame reaches its top.
  • The wait is cancelled by an expand, by a failed collapse, by toggling the option, or when another app takes focus.
  • The decision is a pure function, FullBarActivation.waitsBeforeDeactivating(pointer:screens:barHeight:).

How it was tested

  • macOS 27.2.1, menu bar set to auto-hide, "Make room for icons" on:
    • Before this change, collapsing with the arrow often made the menu bar slide up and come back.
    • With the option off, it never did. This showed the app switch was the cause.
    • With this change and the option back on, it no longer happens.
  • New tests: FullBarDeactivationTests (7). They cover a self-hiding bar and a reserved bar, the very top row, the pointer below the bar, two screens, a taller notch bar, and no screen.
  • scripts/test.sh --scheme direct: 833 passed, 34 failed. The same 34 fail on develop without this change. They are UI text tests, and they fail because the test Mac is set to Japanese.

UI proof

The only change is when focus returns to the previous app. No setting, text, menu or arrow changes.

Tick exactly one:

  • This PR changes something users see, and the proof is above
  • This PR changes nothing users see

🤖 Generated with Claude Code

…fore deactivating

With "Make room for icons while they are shown" on and the macOS menu bar
set to hide by itself, a click on the arrow to collapse handed focus back
to the previous app while the pointer was still in the bar. macOS then
started hiding the menu bar and brought it straight back down.

The collapse now keeps Hidden Bar active until the pointer leaves the bar
(at most 10 s), where the bar hides anyway. A bar that stays on screen
deactivates at once, as before. An expand, a failed collapse or a toggle
of the option cancels the wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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