summaryrefslogtreecommitdiff
path: root/src/gui/gui.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 11:38:06 -0300
committerGabriel Schneider <[email protected]>2026-11-06 12:03:00 -0300
commitf05c69380c8f23ab7dadb1c9d6240af687c88bed (patch)
tree8bb77af9ba2fadf64ac789bbe94c39df346a9db8 /src/gui/gui.zig
parent239e8186111c215bf3bca842216205056e4b00e1 (diff)
downloadpardes-f05c69380c8f23ab7dadb1c9d6240af687c88bed.tar.gz
pardes-f05c69380c8f23ab7dadb1c9d6240af687c88bed.zip
kinds #18, ABI 2.2: pa_api says the core's ABI, pa_mouse grows a wheel's amount (a window passes a touchpad's fraction of a turn over a kind's pane, a terminal whole notches), pa_view says glyphs (no graphics), pa_paint's tail padding holds the pointer the kind asks for (the window shows a hand for PA_POINTER_LINK over its pane, a Shadow's frame carries it), and tick is told PA_FRAMED when a frame was drawn since its last; addon-test gains graphics on|off
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/gui/gui.zig')
-rw-r--r--src/gui/gui.zig14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index e7cd539a..8271699e 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -2900,11 +2900,15 @@ fn wheelAt(g: *Gui, in: *Input, w: WheelTurn, mc: MouseCell) void {
};
if (hit) |id| {
const pane = core.panes[id].?;
- if (pane.addon != null or (!w.mods.shift and pane.isTerminal() and pardes.panes.terminal.ownsWheel(pane))) {
- // The program's (codex, htop, less), or a kind's (a
- // PDF's strip): every whole turn goes to it, no glide,
- // for nothing of ours moves. Shift keeps a terminal's
- // wheel pardes's.
+ if (pane.addon != null) {
+ // A kind's (a PDF's strip): the turn as it came, a
+ // touchpad's fraction of a notch too (pa_mouse.amount).
+ resetScroll(g);
+ in.post(.{ .mouse = .{ .button = if (w.y < 0) .wheel_down else .wheel_up, .kind = .press, .col = mc.col, .row = mc.row, .tag_hit = mc.tag_hit, .body_hit = mc.body_hit, .ctrl = w.mods.ctrl, .shift = w.mods.shift, .alt = w.mods.alt, .amount = @abs(w.y) } });
+ } else if (!w.mods.shift and pane.isTerminal() and pardes.panes.terminal.ownsWheel(pane)) {
+ // The program's (codex, htop, less): every whole turn goes
+ // to it, no glide, for nothing of ours moves. Shift keeps
+ // a terminal's wheel pardes's.
resetScroll(g);
g.program_wheel = accumulateWheelDelta(g.program_wheel, w.y);
while (g.program_wheel >= 1) : (g.program_wheel -= 1)