[PATCH libinput 4/4] Change default DPI to 1000

Peter Hutterer peter.hutterer at who-t.net
Sun Nov 30 16:04:40 PST 2014

400 used to be the default DPI for many mice but it it's not anymore. A survey
of mice shows that 400 is still common as one of the pre-configured settings
in switchable multi-resolution gaming mice, but devices with a single
resolution mostly favor 1000 dpi.

Let's make that switch now so that any future changes to the pointer
acceleration code assumes that resolution as a default.

For the touchpad, this has a bad side-effect, caused by our expectation of
mouse vs touchpad behaviours: our acceleration code ignores device type and
provides the same acceleration for the same physical movement. Unfortunately,
we expect touchpads to be significantly slower than mice.

The previous 400 DPI worked because it caused an acceptable slowdown on input.
e.g. on the T440 with a res of 42 units/mm, the scale coefficient was 0.37.
For 1000 DPI as default, this now results in 0.94, i.e. speeding up the
touchpad by a factor of 2.5. That is way too fast.

Adding touchpad-specific filter code is a bigger project, so let's just add a
fixme for now and scale the coefficient back to what it was before the
DPI default change. Effect: touchpad behaves as before.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
 src/evdev-mt-touchpad.c | 13 +++++++++++++
 src/filter.h            |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index e29b252..67a8d68 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -940,6 +940,19 @@ tp_init_accel(struct tp_dispatch *tp, double diagonal)
 	if (res_x > 1 && res_y > 1) {
 		tp->accel.x_scale_coeff = (DEFAULT_MOUSE_DPI/25.4) / res_x;
 		tp->accel.y_scale_coeff = (DEFAULT_MOUSE_DPI/25.4) / res_y;
+		/* FIXME: once normalized, touchpads see the same
+		   acceleration as mice. that is technically correct but
+		   subjectively wrong, we expect a touchpad to be a lot
+		   slower than a mouse.
+		   For now, apply a magic factor here until this is
+		   fixed in the actual filter code.
+		 */
+		{
+			const double MAGIC = 0.4;
+			tp->accel.x_scale_coeff *= MAGIC;
+			tp->accel.y_scale_coeff *= MAGIC;
+		}
 	} else {
 	 * For touchpads where the driver does not provide resolution, fall
diff --git a/src/filter.h b/src/filter.h
index e96212a..bffeb5f 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -29,7 +29,7 @@
 #include <stdint.h>
 /* The HW DPI rate we normalize to before calculating pointer acceleration */
-#define DEFAULT_MOUSE_DPI 400
+#define DEFAULT_MOUSE_DPI 1000
 struct motion_params {
 	double dx, dy; /* in units/ms @ DEFAULT_MOUSE_DPI resolution */

More information about the wayland-devel mailing list