diff options
Diffstat (limited to 'src/gui/gui.zig')
| -rw-r--r-- | src/gui/gui.zig | 14 |
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) |
