From 9660151c94e988620c79b40a0326057b9854c081 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 27 Sep 2026 22:16:35 -0300 Subject: Move the mouse out of pardes.zig into mouse.zig Pure move, no behaviour change: handleMouse with dragUpdate, dragRelease, seamIdxAt, reportGesture, gestureRange, dispatchPointerBuiltin, mirrorTtySelection and chordCutPaste, the pointer hit helpers (bodyHitForPane, sameTagCell, tagColumn, sameBodyCell), chromeTarget with ChromeTarget, paneAt, the Drag state type with clampBorderCol/Row, the seam test fixtures and thirteen pointer and drag tests go verbatim to mouse.zig. The methods become free functions taking `p: *Pardes`; their 36 call sites change from `p.handleMouse(..)` to `mouse.handleMouse(p, ..)`, including web.zig's chromeTarget and macos.zig's paneAt. The Mouse event type stays in pardes.zig with the rest of the event vocabulary. Co-Authored-By: Claude Opus 5.5 --- src/macos.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/macos.zig') diff --git a/src/macos.zig b/src/macos.zig index cab8212a..f83fb8b4 100644 --- a/src/macos.zig +++ b/src/macos.zig @@ -6,6 +6,7 @@ const builtin = @import("builtin"); const posix = std.posix; const libc = std.c; const pardes = @import("pardes.zig"); +const mouse = @import("mouse.zig"); const colors = @import("colors.zig"); const look = @import("look.zig"); const message = pardes.Messages.Message; @@ -2623,7 +2624,7 @@ const Spent = struct { }; fn spendScroll(st: *State, delta_rows: f32, delta_cols: f32, col: u16, row: u16) Spent { - const pane = if (st.core.paneAt(col, row)) |id| st.core.panes[id] else null; + const pane = if (mouse.paneAt(st.core, col, row)) |id| st.core.panes[id] else null; var out: Spent = .{}; var down_left = takeScrollTicks(&st.scroll_lag, delta_rows); while (down_left != 0) { -- cgit v1.3