mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-07 13:08:04 +02:00
test: when moving 2 fingers, move them in the same frame
More accurate representation of what we actually want to do. Plus it avoids
weird test case failures in semi-mt where we always pick the t/l and b/r
touches for the bounding box. That is the proper behavior for semi-mt, but
it's not for the tests where we expect simultaneous finger movement.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit d19307f20d)
This commit is contained in:
parent
fd278a2eda
commit
ea3f1c2131
1 changed files with 4 additions and 0 deletions
|
|
@ -1500,18 +1500,22 @@ litest_touch_move_two_touches(struct litest_device *d,
|
||||||
int steps, int sleep_ms)
|
int steps, int sleep_ms)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < steps - 1; i++) {
|
for (int i = 0; i < steps - 1; i++) {
|
||||||
|
litest_push_event_frame(d);
|
||||||
litest_touch_move(d, 0, x0 + dx / steps * i,
|
litest_touch_move(d, 0, x0 + dx / steps * i,
|
||||||
y0 + dy / steps * i);
|
y0 + dy / steps * i);
|
||||||
litest_touch_move(d, 1, x1 + dx / steps * i,
|
litest_touch_move(d, 1, x1 + dx / steps * i,
|
||||||
y1 + dy / steps * i);
|
y1 + dy / steps * i);
|
||||||
|
litest_pop_event_frame(d);
|
||||||
if (sleep_ms) {
|
if (sleep_ms) {
|
||||||
libinput_dispatch(d->libinput);
|
libinput_dispatch(d->libinput);
|
||||||
msleep(sleep_ms);
|
msleep(sleep_ms);
|
||||||
}
|
}
|
||||||
libinput_dispatch(d->libinput);
|
libinput_dispatch(d->libinput);
|
||||||
}
|
}
|
||||||
|
litest_push_event_frame(d);
|
||||||
litest_touch_move(d, 0, x0 + dx, y0 + dy);
|
litest_touch_move(d, 0, x0 + dx, y0 + dy);
|
||||||
litest_touch_move(d, 1, x1 + dx, y1 + dy);
|
litest_touch_move(d, 1, x1 + dx, y1 + dy);
|
||||||
|
litest_pop_event_frame(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue