[PR #6843] Account for WHEEL_DELTA when dispatching VT mouse wheel events #26794

Open
opened 2026-01-31 09:18:11 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/6843

State: closed
Merged: Yes


By storing up the accumulated delta in the mouse input handler, we can
enlighten both conhost and terminal about wheel events that are less
than one line in size. Previously, we had a workaround in conhost that
clamped small scroll deltas to a whole line, which made trackpad
scrolling unimaginably fast. Terminal didn't make this mistake, but it
also didn't handle delta accumulation . . . which resulted in the same
behavior.

MouseInput will now wait until it's received WHEEL_DELTA (well-known
constant, value 120) worth of scrolling delta before it dispatches a
single scroll event.

Future considerations may include sending multiple wheel button events
for every multiple of WHEEL_DELTA, but that would be a slightly larger
refactoring that I'm not yet ready to undertake.

There's a chance that we should be dividing WHEEL_DELTA by the system's
"number of lines to scroll at once" setting, because on trackpads
conhost now scrolls a little slow. I think the only way to determine
whether this is palatable is to just ship it.

Fixes #6184.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/6843 **State:** closed **Merged:** Yes --- By storing up the accumulated delta in the mouse input handler, we can enlighten both conhost and terminal about wheel events that are less than one line in size. Previously, we had a workaround in conhost that clamped small scroll deltas to a whole line, which made trackpad scrolling unimaginably fast. Terminal didn't make this mistake, but it also didn't handle delta accumulation . . . which resulted in the same behavior. MouseInput will now wait until it's received WHEEL_DELTA (well-known constant, value 120) worth of scrolling delta before it dispatches a single scroll event. Future considerations may include sending multiple wheel button events for every *multiple* of WHEEL_DELTA, but that would be a slightly larger refactoring that I'm not yet ready to undertake. There's a chance that we should be dividing WHEEL_DELTA by the system's "number of lines to scroll at once" setting, because on trackpads conhost now scrolls a little _slow_. I think the only way to determine whether this is palatable is to just ship it. Fixes #6184.
claunia added the pull-request label 2026-01-31 09:18:11 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26794