Skip to content

fix(native): give up on a collapse macOS never answers - #530

Merged
tieubao merged 2 commits into
developfrom
fix/collapse-on-mic
Nov 17, 2026
Merged

tieubao merged 2 commits into
developfrom
fix/collapse-on-mic

Conversation

@tieubao

@tieubao tieubao commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What

On macOS 27, a collapse in flight ignores every other collapse request. If macOS never answers the section read or the restriction request, the engine stays busy forever: arrow clicks and auto-collapse are silently dropped, the arrow stays at ">", and nothing re-arms the auto-collapse timer. That matches #523 (stuck after joining a meeting) and #524 part 1 (auto-collapse never fires).

Fix

  • NativeVisibilityEngine: each collapse gets a 10 s timeout (collapseTimeout). If the engine is still calibrating at that point, it logs NativeVisibility: macOS did not answer the hide request within 10 s; showing the whole menu bar, lifts any restriction, sets the state to expanded and reports .unavailable. A late answer drops itself through the existing generation check, and a late success is invalidated. The timeout does nothing if the collapse already finished or a newer collapse started.
  • StatusBarController: re-arms auto-collapse when the engine reports a timeout (onCollapseTimedOut).
  • I checked the popup guard (AutoCollapsePopupGuard) and left it unchanged. Its 600 s cap already limits how long it can hold auto-collapse.

Tests

  • New NativeVisibilityEngineTests: a request macOS never answers, a section read that never returns, auto-collapse running again after a timeout, and a timeout that leaves both a finished collapse and a newer one alone.
  • scripts/test.sh: Hidden Bar 678/0, Hidden Bar App Store 444/0.
  • negctl: disabling the timeout turns 3 tests red; restoring it turns them green.

Not proven

  • Not tested on a live macOS 27 bar: no VM run reproduced Google Meet's mic/camera case. The cause is inferred from code and unit tests.

Refs #523 #524

Also in this PR

  • 567c2c8: when the popup guard starts holding auto-collapse, log once which window holds it (owner bundle id or pid, and layer; no window title). It shows whether the 10-minute guard cap is behind a stalled auto-collapse. Suite: Hidden Bar 679/0, App Store 445/0.

A collapse in flight ignores every other collapse request, so when macOS
never answered the section read or the restriction request the engine stayed
busy forever: arrow clicks and auto-collapse were silently dropped and the
auto-collapse timer was never re-armed.

The engine now gives a collapse 10 s. Past that it logs one NativeVisibility
line, lifts any restriction, settles expanded and reports unavailable; a late
answer invalidates itself. The controller re-arms auto-collapse on that event.

The popup guard was checked too: its 600 s cap already bounds it.

Refs #523 #524
When the popup guard starts holding auto-collapse it logs the holding
window's owner (bundle id, or pid when unknown) and layer, once per hold.
No window title or other content is read. This lets a report like #524
show whether the 600 s popup cap is what delays the collapse.

Refs #524
@tieubao
tieubao force-pushed the fix/collapse-on-mic branch from 567c2c8 to 7acb2fa Compare November 17, 2026 06:52
@tieubao
tieubao marked this pull request as ready for review November 17, 2026 06:53
@tieubao
tieubao merged commit 09bc496 into develop Nov 17, 2026
3 checks passed
@tieubao
tieubao deleted the fix/collapse-on-mic branch November 17, 2026 06:56
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