summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-01-23 09:01:24 +1000
committerJosé Expósito <jose.exposito89@gmail.com>2021-08-04 12:09:54 +0200
commitbf8dc2e2ed0780b947eccfc9ac3694c518dee605 (patch)
treea8350f11cc458dc1ba39307b899eb1286f03ecd8
parentecd845c30752a328acfeccb7750dc70350beab0d (diff)
downloadxorg-driver-xf86-input-libinput-bf8dc2e2ed0780b947eccfc9ac3694c518dee605.tar.gz
Upgrade the default scroll distance to 120
This is just a number, to be used as divider and shouldn't have any effect in correctly written clients. With the high-res scrolling coming up however, we have a few devices where the dist cannot be expressed as an integer fraction of 15, so let's up it to 120 because we know all hardware wheels have to be an integer fraction of that that, thanks to Microsoft's API requirements. For non-wheel scrolls we need to now map into the new range. Previously we just passed the scroll events on from the touchpad/button scrolling, meaning a vdist of 15 meant 15 "libinput pixels" of scrolling resulted in a logical wheel click. Now that we have 120 as vdist, we need to times the input data by 8 to keep the same proportions. See 39b0bb4585106a56a51236d8e9843b2da8d745a5 for the previous revert. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/xf86libinput.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/xf86libinput.c b/src/xf86libinput.c
index 33b02da..adbc724 100644
--- a/src/xf86libinput.c
+++ b/src/xf86libinput.c
@@ -1652,8 +1652,11 @@ calculate_axis_value(struct xf86libinput *driver_data,
* device. The user may change the ScrollPixelDistance
* though, so where we have a dist of 10 but an increment of
* 15, we need to scale from 0..10 into 0..15.
+ *
+ * We now switched to vdist of 120, so make this
+ * proportionate - 120/15 is 8.
*/
- value = value/dist * SCROLL_INCREMENT;
+ value = value/dist * SCROLL_INCREMENT * 8;
}
*value_out = value;
@@ -3585,8 +3588,8 @@ xf86libinput_pre_init(InputDriverPtr drv,
* affect touchpad scroll speed. For wheels it doesn't matter as
* we're using the discrete value only.
*/
- driver_data->scroll.v.dist = SCROLL_INCREMENT;
- driver_data->scroll.h.dist = SCROLL_INCREMENT;
+ driver_data->scroll.v.dist = 120;
+ driver_data->scroll.h.dist = 120;
if (!is_subdevice) {
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER))