From 2a612997abaed6deca08d8dc7fc54079b7aabcf4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 15 Sep 2016 11:53:44 +1000 Subject: [PATCH] tools: fix kernel-announced width/height Side-effect of 240ba34ebd483 was that "touchpad size as listed by the kernel" was now dependent on the values we got. This one is a static one based on the axis info. Signed-off-by: Peter Hutterer --- tools/touchpad-edge-detector.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/touchpad-edge-detector.c b/tools/touchpad-edge-detector.c index ca34414..cc81ec1 100644 --- a/tools/touchpad-edge-detector.c +++ b/tools/touchpad-edge-detector.c @@ -190,8 +190,10 @@ print_udev_override_rule(struct libevdev *dev, yres = round((double)h/size->h); if (x->resolution && y->resolution) { + int width = x->maximum - x->minimum, + height = y->maximum - y->minimum; printf("Touchpad size as listed by the kernel: %dx%dmm\n", - w/x->resolution, h/y->resolution); + width/x->resolution, height/y->resolution); } else { printf("Touchpad has no resolution, size unknown\n"); }