touchpad: simplify linear acceleration profile for a more natural response
When coming from macOS to Fedora, I find it more difficult to use the trackpad to do text selection precisely. The cursor is moving too fast to let me select text at character level. However, if I reduce the touchpad speed in GNOME Settings, it becomes painfully slow to move the cursor across the screen. I tried both Flat and Adaptive profile, neither of them solves the aforementioned problem.
The cause is that the acceleration profile of libinput is very different from the ones on macOS and on Windows (of course I am unable to confirm what the profiles on those systems actually are, but they do feel very different from libinput's). As explain in the comment of
filter-touchpad.c, libinput's profile looks like this:
accel factor ^ ______ | ) | _____) | / |/ +-------------> speed in
The problems (in my opinion) are:
- The acceleration factor ramp up way too fast at low speed. This makes it difficult to control the cursor precisely to do things like selecting a single character.
- The acceleration factor suddenly stops ramping at a certain speed, making it feel unnatural.
- The acceleration factor suddenly starts to ramp again at a higher speed, making it feel unnatural.
Instead of the ramp-flat-curve-flat profile, use a smooth and monotonically increasing function.
factor = 0.2 * pow(speed_in, 0.55);
- The new profile feels more similar to the ones on macOS and Windows. It makes people's lives easier when switching back and forth between Linux, macOS, and Windows.
- The new profile makes it easier to do text selections precisely at low speed, while maintain agility at high speed.
- The new profile feels more natural since its first derivative is continuous.
- The new profile is simpler and easier to understand / tune.
Related to: #350