summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-11-28 10:09:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-12-02 10:16:31 +1000
commit3c7e3a19735b64eaa7937035d026b62c5fccbf5c (patch)
tree85844686d2922441fe845845fd28404ed2311c34
parent7e3cc15819f5599ee2014dc8381ef1bcb4c2ac73 (diff)
downloadlibinput-3c7e3a19735b64eaa7937035d026b62c5fccbf5c.tar.gz
Change default DPI to 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>
-rw-r--r--src/evdev-mt-touchpad.c13
-rw-r--r--src/filter.h2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index e29b2527..67a8d68a 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 e96212a3..bffeb5f9 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 */