[PATCH libevdev] tools: fix the touchpad resolution calculation

Peter Hutterer peter.hutterer at who-t.net
Thu Aug 25 21:57:17 UTC 2016


Previous ones used the absinfo from the kernel but since we never updated that
from within the tool, the output was always the same.

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

diff --git a/tools/touchpad-edge-detector.c b/tools/touchpad-edge-detector.c
index e09f028..ca34414 100644
--- a/tools/touchpad-edge-detector.c
+++ b/tools/touchpad-edge-detector.c
@@ -184,8 +184,8 @@ print_udev_override_rule(struct libevdev *dev,
 
 	x = libevdev_get_abs_info(dev, ABS_X);
 	y = libevdev_get_abs_info(dev, ABS_Y);
-	w = x->maximum - x->minimum;
-	h = y->maximum - y->minimum;
+	w = dim->right - dim->left;
+	h = dim->bottom - dim->top;
 	xres = round((double)w/size->w);
 	yres = round((double)h/size->h);
 
-- 
2.7.4



More information about the Input-tools mailing list