Repository navigation
Fix top-bar hover crash on Sonoma and Sequoia - #550
dragonhuntr wants to merge 2 commits into
Conversation
Defer titlebar drag-handle hit capture for passive hover/system events and extend regression tests for those event types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…lated The static method only dispatches to a background queue and doesn't access main-actor state, so it can safely be nonisolated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@dragonhuntr is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Fixes a macOS crash related to titlebar drag-handle hit-testing on newer macOS versions by ensuring hover/tracking/system events don’t get treated like click events, and resolves a Swift concurrency build issue around Launch Services registration scheduling.
Changes:
- Update drag-handle hit-capture deferral logic to ignore
mouseEntered,mouseExited,appKitDefined, andsystemDefinedevents. - Add unit tests asserting the drag handle does not capture hits for those passive/system event types.
- Mark
enqueueLaunchServicesRegistrationWorkasnonisolatedso it can be used as a scheduler without main-actor isolation issues.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
cmuxTests/CmuxWebViewKeyEquivalentTests.swift |
Extends hit-test coverage to ensure passive/system event types don’t trigger drag-handle capture. |
Sources/WindowDragHandleView.swift |
Expands the set of event types that should defer drag-handle hit capture (prevents hover/system-event crash). |
Sources/AppDelegate.swift |
Adjusts Launch Services scheduling helper to be nonisolated to fix concurrency/build constraints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Nice — I was working on this same crash this morning. I filed #490 yesterday with a detailed breakdown after digging into the root cause. The deferral expansion here looks correct for the tracking-area events (scenario 2 in the issue), but there's a third crash scenario this doesn't cover: Layout-triggered hitTest with stale Two additional hardening suggestions:
// WindowDragHandleView.swift
var windowDragHandleIsInEventDispatch = false
// In DraggableView.hitTest:
override func hitTest(_ point: NSPoint) -> NSView? {
guard windowDragHandleIsInEventDispatch else { return nil }
// ... existing logic
}
// AppDelegate.swift, in cmux_sendEvent:
let wasInEventDispatch = windowDragHandleIsInEventDispatch
windowDragHandleIsInEventDispatch = true
defer { windowDragHandleIsInEventDispatch = wasInEventDispatch }The drag handle still works for real mouse-button events since those always go through |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Thanks for this! The titlebar hover crash fix (hitTest now bails out for anything but left-mouse-down) landed on main in #736. You opened this first, so you got there first. Closing since main covers it now. |
Summary
WindowDragHandleViewcapturingmouseEntered,mouseExited,appKitDefined, andsystemDefinedevents that should be deferred — these tracking/system events were incorrectly handled as click-like events on Sonoma and SequoiaenqueueLaunchServicesRegistrationWorkasnonisolatedsince it only dispatches to a background queueTest plan
🤖 Generated with Claude Code