[PATCH libinput 04/13] touchpad: init the device's dpi correctly

Peter Hutterer peter.hutterer at who-t.net
Mon Dec 19 05:20:55 UTC 2016


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 at who-t.net>
---
 src/evdev-mt-touchpad.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 26b65de..a5ab4c2 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -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))
-- 
2.9.3



More information about the wayland-devel mailing list