mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-04 00:20:14 +01:00
litest: Make touchpad_2fg_scroll_slow_distance take resolution into account
Currently touchpad_2fg_scroll_slow_distance always moves the touches 10% of the touchpad height during the test. On the wacom-intuos-finger test device this is a much larger distance then on the synaptics test device, triggering ck_assert(axisval < 5.0) errors with further patches in this set, this commit fixes this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
8ffc213408
commit
2ab0db9ee9
1 changed files with 13 additions and 2 deletions
|
|
@ -1864,13 +1864,24 @@ START_TEST(touchpad_2fg_scroll_slow_distance)
|
|||
struct libinput *li = dev->libinput;
|
||||
struct libinput_event *event;
|
||||
struct libinput_event_pointer *ptrev;
|
||||
const struct input_absinfo *y;
|
||||
double y_move;
|
||||
|
||||
/* We want to move > 5 mm. */
|
||||
y = libevdev_get_abs_info(dev->evdev, ABS_Y);
|
||||
if (y->resolution) {
|
||||
y_move = 7.0 * y->resolution /
|
||||
(y->maximum - y->minimum) * 100;
|
||||
} else {
|
||||
y_move = 10.0;
|
||||
}
|
||||
|
||||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(dev, 0, 20, 30);
|
||||
litest_touch_down(dev, 1, 40, 30);
|
||||
litest_touch_move_to(dev, 0, 20, 30, 20, 40, 70, 10);
|
||||
litest_touch_move_to(dev, 1, 40, 30, 40, 40, 70, 10);
|
||||
litest_touch_move_to(dev, 0, 20, 30, 20, 30 + y_move, 70, 10);
|
||||
litest_touch_move_to(dev, 1, 40, 30, 40, 30 + y_move, 70, 10);
|
||||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue