mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-04 21:08:07 +02:00
test: run pinch gesture tests for 2-slot touchpads
Some of the 2-slot touchpads don't do gestures though (e.g. semi-mt) so skip
those.
And change the movement granularity for the pinch and spread tests so we stay
under one degree angle for lower-resolution touchpads too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ff2ee2c681)
This commit is contained in:
parent
7cce284063
commit
dcd48bb3b3
1 changed files with 18 additions and 14 deletions
|
|
@ -180,7 +180,9 @@ START_TEST(gestures_pinch)
|
||||||
{ -30, 30 },
|
{ -30, 30 },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (libevdev_get_num_slots(dev->evdev) < 3)
|
if (libevdev_get_num_slots(dev->evdev) < 2 ||
|
||||||
|
!libinput_device_has_capability(dev->libinput_device,
|
||||||
|
LIBINPUT_DEVICE_CAP_GESTURE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dir_x = cardinals[cardinal][0];
|
dir_x = cardinals[cardinal][0];
|
||||||
|
|
@ -195,13 +197,13 @@ START_TEST(gestures_pinch)
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
litest_push_event_frame(dev);
|
litest_push_event_frame(dev);
|
||||||
if (dir_x > 0.0)
|
if (dir_x > 0.0)
|
||||||
dir_x -= 3;
|
dir_x -= 2;
|
||||||
else if (dir_x < 0.0)
|
else if (dir_x < 0.0)
|
||||||
dir_x += 3;
|
dir_x += 2;
|
||||||
if (dir_y > 0.0)
|
if (dir_y > 0.0)
|
||||||
dir_y -= 3;
|
dir_y -= 2;
|
||||||
else if (dir_y < 0.0)
|
else if (dir_y < 0.0)
|
||||||
dir_y += 3;
|
dir_y += 2;
|
||||||
litest_touch_move(dev,
|
litest_touch_move(dev,
|
||||||
0,
|
0,
|
||||||
50 + dir_x,
|
50 + dir_x,
|
||||||
|
|
@ -269,17 +271,19 @@ START_TEST(gestures_spread)
|
||||||
double scale, oldscale;
|
double scale, oldscale;
|
||||||
double angle;
|
double angle;
|
||||||
int cardinals[8][2] = {
|
int cardinals[8][2] = {
|
||||||
{ 0, 1 },
|
{ 0, 30 },
|
||||||
{ 1, 1 },
|
{ 30, 30 },
|
||||||
{ 1, 0 },
|
{ 30, 0 },
|
||||||
{ 1, -1 },
|
{ 30, -30 },
|
||||||
{ 0, -1 },
|
{ 0, -30 },
|
||||||
{ -1, -1 },
|
{ -30, -30 },
|
||||||
{ -1, 0 },
|
{ -30, 0 },
|
||||||
{ -1, 1 },
|
{ -30, 30 },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (libevdev_get_num_slots(dev->evdev) < 3)
|
if (libevdev_get_num_slots(dev->evdev) < 2 ||
|
||||||
|
!libinput_device_has_capability(dev->libinput_device,
|
||||||
|
LIBINPUT_DEVICE_CAP_GESTURE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dir_x = cardinals[cardinal][0];
|
dir_x = cardinals[cardinal][0];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue