Ideally we want to specify various thresholds in mm, but not all touchpads
set the hardware resolutions. Rather than conditions to check for resolutions
everywhere, use a macro to give us a normalized value that we use for motion
as well.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
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 {
/*
#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),
#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,
#include <stdbool.h>
#include <stdint.h>
-/* 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 */
};