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 <[email protected]>
---
 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

_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to