I've recently been trying out Ubuntu 20.10 with Gnome desktop on Wayland, using a touchpad that supports precision scrolling, i.e. which does not emulate a mousewheel.
After enabling natural scrolling for the touchpad the scroll gestures I make with my fingers map naturally to the movement of all the scrollable content on screen (moving my fingers upwards moves the content upwards). This is opposed to mapping the physical gesture to the movement of the "scrollbar thumb" (the handle) where moving my fingers upwards would move the thumb upwards, but the content downwards.
However when hovering over a GUI element with an unambiguous mapping from physical to visual movement, such as the system's volume slider, the mapping between gesture and widget movement is surprisingly broken. In other words, an upwards gesture results in a downwards adjustment of the slider handle (let's ignore that the slider is horizontal -- if it were vertical it would undoubtedly literally have moved downwards). Obviously the widget is using the wrong abstraction to determine the direction of its movement.
Quick overview (precision scrolling)
In this post I'm focusing on precision scrolling events from modern touchpads since I get the impression that that is the most modern scrolling API.
- Natural scrolling
- Physical movement: down
- Scrollable content movement: down (match)
- Slider movement: up (mismatch)
- Physical movement: down
- "Normal" scrolling
- Physical movement: down
- Scrollbar "thumb" movement: down (match)
- Slider movement: down (match)
- Physical movement: down
As mentioned, the slider has an unambiguous mapping between its movement and gesture movement but still manages to do the wrong thing. (It's unambiguous since a slider only has one moving part, as opposed to scrollable views which have two moving parts: content, and scrollbar thumb)
Could you explain to me how a widget like this could determine the correct gesture direction instead of using the wrong abstraction as it does currently? How would it go about getting the absolute direction of movement? Why doesn't it already do this?
I'm not asking as a developer in this case, but as someone interested in interaction design and in this problem. It seems like a simple thing to use the absolute direction of movement in all widgets that don't incorporate a scrollbar, since there is no ambiguity. I'm currently not very familiar with the intricacies of event handling in various Linux desktop environments.