tools: fix the touchpad resolution calculation
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 25 Aug 2016 21:54:01 +0000 (07:54 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 26 Aug 2016 01:43:54 +0000 (11:43 +1000)
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@who-t.net>
tools/touchpad-edge-detector.c

index e09f028269799f07bbab31c0fe67e7b7e379137b..ca34414d728d36ca1e42776642ff975fa8fcdb80 100644 (file)
@@ -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);