Add nil guard in forceRefresh() to prevent dereferencing freed surface
pointer. Split else-if chains in Workspace.swift so
requestBackgroundSurfaceStartIfNeeded() runs if surface is freed during
the refresh call. Add regression test exercising the crash path.
Add window-identity check to windowDragHandleShouldCaptureHit so stale
leftMouseDown events from other apps (Finder, Dock) during launch don't
trigger the SwiftUI hierarchy walk while initial layout is mutating.
Add NSLock to breadcrumb limiter for thread safety. Update existing
tests to pass eventWindow for window-attached drag handles.
The equalize splits command was a no-op that always returned false.
Implement it by recursively walking the bonsplit tree and setting
every split divider position to 0.5. Also register the command in
the command palette with a "workspace has splits" precondition so
it only appears when there are multiple panes.
Adds a regression test that creates a nested split layout, skews
divider positions, equalizes, and verifies all dividers are at 0.5.
Fixes https://github.com/manaflow-ai/cmux/issues/571
During app launch, mouseMoved events can trigger hitTest on the drag
handle while SwiftUI is still modifying view state in a layout pass.
The previous blacklist approach (only deferring mouseMoved, cursorUpdate,
nil) let unexpected event types slip through — e.g. activation events
where NSApp.currentEvent is not the mouseMoved being routed — causing
contentView.hitTest() to re-enter SwiftUI views and trigger an exclusive
access violation.
Switch to a whitelist: only leftMouseDown (the sole event the drag
handle actually handles) proceeds with the full view-hierarchy walk.
All other event types bail out immediately. The deferred-event check
runs after suppression recovery (which uses only ObjC associated-object
calls, safe from Swift exclusivity) so stale suppression is still
cleared on passive events, but before the view-hierarchy walk that
triggered the crash.
Fixes#490
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>