Repository navigation
fix(native): scroll the terminal by wheel notch, eased over frames - #943
Merged
Merged
Conversation
A Wayland wheel notch reaches Gio as one 150-pixel delta, which the terminal turned into some eight rows in a single frame, and into eight wheel steps for a program tracking the mouse. A notch now moves three rows of scrollback or arrow keys, or one wheel step to a tracking program, and the rows ease out over a few frames. Touchpad deltas, which are not whole notches, keep scrolling a row per cell height.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wheelNotchper platform, from Gio's own scaling: 150 on Wayland and 10 on X11 (picked byWAYLAND_DISPLAY, the check Gio itself opens Wayland on), 120 on Windows (WHEEL_DELTA), 10 on macOS.[Unreleased]› Fixed entry.Test plan
TestWheelNotchesScrollTheScrollbackOverSeveralFrames: two notches up leave the viewport where it was until a frame, move part of the way on the first and six rows once drained.TestWheelNotchesReachAFullScreenProgramOverSeveralFrames: three notches send nine arrow keys, or three wheel steps under mouse tracking, spread over frames.TestTouchpadDeltasUnderACellStillScroll: four quarter-row deltas still make one row, as arrow keys and as a wheel step.TestMouseGoesToTheProgramThatTracksItandTestWheelMovesTheCursorOnTheAlternateScreennow scroll by notches and collect what the frames send: the contract changed, a wheel now counts notches and pays out over frames.native/:gofmt,go vet ./...,go test ./....