[PATCH libinput 1/4] test: start with the first offset when moving touches

Peter Hutterer peter.hutterer at who-t.net
Tue Nov 22 01:32:41 UTC 2016


This doesn't have an effect in our current tests because the touchpad always
needs 4 motion events to get moving. But for the future, it simplifies the
case of "i want to move between x1/y1 and x2/y2", because it fills in only the
events in between rather than re-using the touch down coordinates and thus not
causing a motion on the first event.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/litest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/litest.c b/test/litest.c
index 94da85a..e685d61 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -1603,7 +1603,7 @@ litest_touch_move_to(struct litest_device *d,
 		     double x_to, double y_to,
 		     int steps, int sleep_ms)
 {
-	for (int i = 0; i < steps - 1; i++) {
+	for (int i = 1; i < steps - 1; i++) {
 		litest_touch_move(d, slot,
 				  x_from + (x_to - x_from)/steps * i,
 				  y_from + (y_to - y_from)/steps * i);
@@ -1699,7 +1699,7 @@ litest_touch_move_two_touches(struct litest_device *d,
 			      double dx, double dy,
 			      int steps, int sleep_ms)
 {
-	for (int i = 0; i < steps - 1; i++) {
+	for (int i = 1; i < steps; i++) {
 		litest_push_event_frame(d);
 		litest_touch_move(d, 0, x0 + dx / steps * i,
 					y0 + dy / steps * i);
-- 
2.9.3



More information about the wayland-devel mailing list