FR - 2fg Scroll - Make exact 0° 90° 180° 270° scrolls easier
I'll be happy to give implementing this a try, if this is something that might be acceptable.
The ideal implementation must not break existing free-scrolling functionality, but should improve the experience of scrolling straight up/down a text file, without accidentally scrolling horizontally and losing sight of the beginnings of lines; or left/right in a video or audio editor, without accidentally scrolling up or down through the track list.
Steps to reproduce issue
- Turn on "libinput Horizontal Scroll Enabled"
- Launch gedit, pluma, Kate, or Sublime Text (I tested in these; others are likely similar)
- Open a long text file wider than the current window (may need to resize the window)
- Scroll down
- Even if extremely careful to scroll straight down, horizontal scrolling is observed
- A mostly-downward scroll gesture causes a straight downward scroll
- Scroll gestures starting with angles far from 0°/90°/180°/270°, or scroll gestures that veer far from square while moving, must still allow free scrolling in any direction
I see that in evdev_post_scroll at evdev.c:2408, there is some code to require a certain delta to scroll in each direction. That appears to be a different case since it doesn't handle, say, scrolling at an 88° angle when intending 90°.
Edit: see implementation at https://gitlab.freedesktop.org/mdmayfield/libinput/commits/scroll-vectors-squash