Repository navigation
fix: suppress motion reports during a cmd-clicked link drag (follow-up to #74) - #75
Conversation
Review follow-up (codex P2 on cmux ghostty-org#5128). mouseButtonCallback suppresses the press and release of a ctrl/super-chord link click, but cursorPosCallback still emitted .motion reports while the button was held (click_state == .press), so a slight drag during link activation leaked button-motion to a mouse-grabbing program. Mirror the existing shift "grab override" for the ctrl/super chord in the motion-report path — suppressing only while a button is pressed so pure movement reports are unaffected. Completes the click+drag suppression across press, release, and motion for the link chord. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 39 minutes and 59 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR closes the last leak path from the ctrl/super link-activation chord by suppressing button-motion reports in
Confidence Score: 5/5Safe to merge — the change is a surgical 12-line addition that closes a well-defined motion-report leak with no side-effects on unrelated code paths. The guard mirrors the existing shift override character-for-character, uses self.mouse.mods that is already updated at the top of cursorPosCallback before this block runs, and is consistent with the unconditional ctrl/super suppression in mouseButtonCallback and mouseLinkRefreshAllowedState. Pure movement (no button held) is explicitly unaffected, and no existing behavior is touched. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Surface
participant TUI as Mouse-grabbing TUI
Note over User,TUI: Before this fix (ctrl/super held + button drag)
User->>Surface: mouseButtonCallback (press, ctrl/super)
Surface-->>TUI: "suppressed by #74"
User->>Surface: cursorPosCallback (drag, button held)
Surface->>TUI: motion report LEAKED
Note over User,TUI: After this fix
User->>Surface: mouseButtonCallback (press, ctrl/super)
Surface-->>TUI: "suppressed (#74)"
User->>Surface: cursorPosCallback (drag, button held, ctrl/super)
Note over Surface: mods.equal(ctrlOrSuper) AND any state != .release
Surface-->>TUI: suppressed (this PR)
User->>Surface: cursorPosCallback (pure movement, no button held)
Surface->>TUI: motion report sent (unaffected)
User->>Surface: mouseButtonCallback (release, ctrl/super)
Surface-->>TUI: "suppressed (#74)"
Reviews (1): Last reviewed commit: "fix: also suppress motion reports during..." | Re-trigger Greptile |
…mux ghostty-org#5128) Final review follow-up to #71/#74/#75: scopes the link-chord click/drag suppression to the left button and clears stale link hover when the chord drops via cursor mods. Merge commit keeps f241952 an ancestor of fork main.
Final follow-up to #71/#74 for manaflow-ai/cmux#5128.
#71 made Cmd-click open links under mouse reporting; #74 stopped the press/release of that click from leaking to a mouse-grabbing alt-screen TUI by suppressing the report whenever the ctrl/super link chord is held. This closes the last leak path:
cursorPosCallbackstill emitted.motionreports while a button was held during the chord (it seesclick_state == .press), so a slight drag during link activation leaked button-motion to the program.Mirror the existing shift "grab override" for the ctrl/super chord in the motion-report path — suppressing only while a button is pressed, so pure movement reports are unaffected. With this, the link-activation chord suppresses the whole click+drag (press, release, and motion) consistently, matching iTerm2 / macOS Terminal.
zig fmt/ast-checkclean. Behavior is integration-level (liveSurface+ mouse-reporting program), verified by cmux dogfood.AI disclosure (per AI_POLICY.md): developed with Claude Code (Claude Opus 4.8); reviewed by a maintainer.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Prevent button-motion events from leaking to mouse-grabbing programs when cmd/super-clicking a link and dragging. The link-activation chord now suppresses press, release, and motion consistently, closing the last leak in manaflow-ai/cmux#5128.
cursorPosCallback, suppress motion while a button is pressed and the ctrl/super chord is held (mirrors the shift override). Pure movement without a pressed button is unaffected.Written for commit 76ead3e. Summary will update on new commits.