Change default DPI to 1000
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 28 Nov 2014 00:09:21 +0000 (10:09 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 2 Dec 2014 00:16:31 +0000 (10:16 +1000)
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@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad.c
src/filter.h

index e29b2527ea69908df0ca2c0d23468799c104651e..67a8d68aab36c19afedfa0b49f7b73ff881b20ec 100644 (file)
@@ -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
index e96212a3d023a953ac98fdda883c6e434beeac55..bffeb5f98516e9473794c00c54bfc7035bd1a281 100644 (file)
@@ -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 */