diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 9b065221..88088503 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -994,9 +994,8 @@ tp_init_accel(struct tp_dispatch *tp, double diagonal) fixed in the actual filter code. */ { - const double MAGIC = 0.4; - tp->accel.x_scale_coeff *= MAGIC; - tp->accel.y_scale_coeff *= MAGIC; + tp->accel.x_scale_coeff *= TP_MAGIC_SLOWDOWN; + tp->accel.y_scale_coeff *= TP_MAGIC_SLOWDOWN; } } else { /* diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h index 1b8b560f..de8b60d7 100644 --- a/src/evdev-mt-touchpad.h +++ b/src/evdev-mt-touchpad.h @@ -34,6 +34,11 @@ #define VENDOR_ID_APPLE 0x5ac +/* Touchpad slowdown factor, see the FIXME in tp_init_accel() */ +#define TP_MAGIC_SLOWDOWN 0.4 +/* Convert mm to a distance normalized to DEFAULT_MOUSE_DPI */ +#define TP_MM_TO_DPI_NORMALIZED(mm) (DEFAULT_MOUSE_DPI/25.4 * TP_MAGIC_SLOWDOWN * mm) + enum touchpad_event { TOUCHPAD_EVENT_NONE = 0, TOUCHPAD_EVENT_MOTION = (1 << 0), diff --git a/src/evdev.h b/src/evdev.h index 72082e5a..9e8d6af0 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -33,6 +33,9 @@ #include "libinput-private.h" #include "timer.h" +/* The HW DPI rate we normalize to before calculating pointer acceleration */ +#define DEFAULT_MOUSE_DPI 1000 + enum evdev_event_type { EVDEV_NONE, EVDEV_ABSOLUTE_TOUCH_DOWN, diff --git a/src/filter.h b/src/filter.h index 9f6223d2..9e903303 100644 --- a/src/filter.h +++ b/src/filter.h @@ -28,9 +28,6 @@ #include #include -/* The HW DPI rate we normalize to before calculating pointer acceleration */ -#define DEFAULT_MOUSE_DPI 1000 - struct motion_params { double dx, dy; /* in units/ms @ DEFAULT_MOUSE_DPI resolution */ };