Repository navigation
cmux-next: debug.mouse middle clicks keep their window-local point - #17624
Conversation
76c37a6 makes a middle-button event by copying an NSEvent through CGEvent to set buttonNumber 2. The copy kept no global point AppKit could map back, so on the CI Mac its locationInWindow came out (20, -700) instead of (20, 180), and DebugMouseButtonTests and WorkspaceRowMiddleClickTests fail on feat-cmux-next. The copy is now addressed like debug.mouse's scroll events (global point from the primary screen's top-left, and the window under it), in one shared helper; the row test builds its event the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
Not verified: macOS jobs did not run: compile and app tests were skipped on CI passes on Written by |
…pped wrong Setting the copy's global point changed nothing on CI: AppKit maps a CGEvent through the window server's frame for the window, and for the tests' unshown windows that frame differs from the window's own by the screen height minus the window's (880 and 480). debug.mouse now builds the copy, measures the window-local point AppKit got, moves the global point by the difference and builds it again; the row test does the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Fix forward for two
cmux-next swift testfailures on feat-cmux-next. Both came in with 76c37a6 (debug.mousemiddle button):DebugMouseButtonTests.middleButtonEventsKeepTheWindowLocalPoint:locationInWindowis (20, -700), expected (20, 180).WorkspaceRowMiddleClickTests.middleButtonEventsAtTheRowCloseTheWorkspace: wrong point, so the row never sees the click and nothing closes.Cause:
debug.mousemakes a middle-button event by copying anNSEventthroughCGEventto setbuttonNumber2. AppKit maps the copy back through the window server's frame for the window. The tests use windows that are never shown, and for those the server's frame differs from the window's own. The offset is the screen height minus the window height: 880 for the 200-point test window, 480 for the row harness. Setting the copy's global point alone did not help (first CI run on this PR).Fix:
DebugMouse.keepingWindowPointbuilds the copy once and measures the window-local point AppKit got. It moves the global point by the difference and builds it again, so the event lands at the intended point whatever frame the server holds. The row test lives in the Sidebar package, which can't reachDebugMouse, so it does the same inline.QuitSessionsTestsis a separate base red, fixed by #17605.Testing
cmux-next swift testjob on cmux-next: chat summary keeps Outputs, Subagents and Sources in place #17602 at 00792b8). This PR'scmux-next swift testrun is the green check. Swift does not build or run locally here.Changelog
none
🤖 Generated with Claude Code