diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2019-10-14 11:23:30 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2019-10-14 02:57:48 +0000 |
commit | 2b33445bc9b57d0d450b056c4672be3c06db71c5 (patch) | |
tree | 1dcee9f2324ae1d228653f8aa3bd5e71f34198a2 /test | |
parent | c20d08ac23ec51d040aada892940c389115d1b93 (diff) |
touchpad: use the same speed for scrolling as the baseline of the accel curve
Scrolling and gestures use unaccelerated motion. The idea behind it was that
at least for the default speed setting of 0, the accelerated speed and
unaccelerated speed are identical where meaningful.
The touchpad speed curve has a plateau for 'normal' speeds (i.e. not very slow
and not very fast) where the acceleration factor is constant. This is the
reference factor that the unaccelerated motion should use as well.
Since the touchpad acceleration rework in d6e5313497 the reference factor is
0.9 * TP_MAGIC_SLOWDOWN (previously the factor was 1.0 * TP_MAGIC_SLOWDOWN)
and scroll motion is thus 10% faster than the pointer movement at the default
speeds. Let's fix this and let the two match up.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/test-touchpad.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/test-touchpad.c b/test/test-touchpad.c index 38506768..73dd9f0d 100644 --- a/test/test-touchpad.c +++ b/test/test-touchpad.c @@ -150,13 +150,13 @@ START_TEST(touchpad_2fg_scroll) litest_drain_events(li); test_2fg_scroll(dev, 0.1, 40, false); - litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, 10); + litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, 9); test_2fg_scroll(dev, 0.1, -40, false); - litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, -10); + litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, -9); test_2fg_scroll(dev, 40, 0.1, false); - litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, 10); + litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, 9); test_2fg_scroll(dev, -40, 0.1, false); - litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, -10); + litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, -9); /* 2fg scroll smaller than the threshold should not generate events */ test_2fg_scroll(dev, 0.1, 0.1, true); @@ -602,13 +602,13 @@ START_TEST(touchpad_scroll_natural_2fg) libinput_device_config_scroll_set_natural_scroll_enabled(dev->libinput_device, 1); test_2fg_scroll(dev, 0.1, 40, false); - litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, -10); + litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, -9); test_2fg_scroll(dev, 0.1, -40, false); - litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, 10); + litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, 9); test_2fg_scroll(dev, 40, 0.1, false); - litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, -10); + litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, -9); test_2fg_scroll(dev, -40, 0.1, false); - litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, 10); + litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, 9); } END_TEST |