From 618ee6ac9495297a74059f95ad140928b2ea1fb7 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 11 Jan 2017 09:49:37 +1000 Subject: [PATCH] test: force a pressure of 0 when we hover a touch As we switch to pressure-based touch detection, we need for all pressure-capable touchpads to send pressure values. They'll do so by filling in an axis default but that breaks our current hover code. Make sure the hover litest helpers force a pressure of 0. Signed-off-by: Peter Hutterer --- test/litest.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/litest.c b/test/litest.c index 1bb18dde..21afaf9b 100644 --- a/test/litest.c +++ b/test/litest.c @@ -1799,7 +1799,13 @@ litest_hover_start(struct litest_device *d, double x, double y) { - litest_slot_start(d, slot, x, y, NULL, 0); + struct axis_replacement axes[] = { + {ABS_MT_PRESSURE, 0 }, + {ABS_PRESSURE, 0 }, + {-1, -1 }, + }; + + litest_slot_start(d, slot, x, y, axes, 0); } void @@ -1838,7 +1844,13 @@ void litest_hover_move(struct litest_device *d, unsigned int slot, double x, double y) { - litest_slot_move(d, slot, x, y, NULL, false); + struct axis_replacement axes[] = { + {ABS_MT_PRESSURE, 0 }, + {ABS_PRESSURE, 0 }, + {-1, -1 }, + }; + + litest_slot_move(d, slot, x, y, axes, false); } void