touchpad: init the device's dpi correctly
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 15 Dec 2016 02:45:38 +0000 (12:45 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 21 Dec 2016 00:55:56 +0000 (10:55 +1000)
This has no real effect just yet because we don't use a touchpad's dpi
anywhere in the touchpad code. Only the acceleration code wants it but all
touchpads use the same acceleration method, and that one doesn't care about
the dpi.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad.c

index 26b65de956a977fdfb72becb86093aa4ea3c6f0b..a5ab4c2ed2c1331c3487295975f313432ab953d2 100644 (file)
@@ -2257,6 +2257,10 @@ tp_init(struct tp_dispatch *tp,
                                                       EV_ABS,
                                                       ABS_MT_DISTANCE);
 
+       /* Set the dpi to that of the x axis, because that's what we normalize
+          to when needed*/
+       device->dpi = device->abs.absinfo_x->resolution * 25.4;
+
        tp_init_hysteresis(tp);
 
        if (!tp_init_accel(tp))