touchpad: hook up pointer acceleration configuration
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 3 Jul 2014 23:44:43 +0000 (09:44 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 23 Sep 2014 00:46:35 +0000 (10:46 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad.c
src/evdev.c
src/evdev.h

index 68268cd..8b6f98e 100644 (file)
@@ -806,7 +806,6 @@ tp_init_slots(struct tp_dispatch *tp,
 static int
 tp_init_accel(struct tp_dispatch *tp, double diagonal)
 {
-       struct motion_filter *accel;
        int res_x, res_y;
 
        if (tp->has_mt) {
@@ -843,13 +842,9 @@ tp_init_accel(struct tp_dispatch *tp, double diagonal)
                tp->accel.y_scale_coeff = DEFAULT_ACCEL_NUMERATOR / diagonal;
        }
 
-       accel = create_pointer_accelator_filter(
-                       pointer_accel_profile_linear);
-       if (accel == NULL)
+       if (evdev_device_init_pointer_acceleration(tp->device) == -1)
                return -1;
 
-       tp->device->pointer.filter = accel;
-
        return 0;
 }
 
index a5a8372..4c0669c 100644 (file)
@@ -893,8 +893,8 @@ evdev_accel_config_get_default_speed(struct libinput_device *device)
        return 0.0;
 }
 
-static int
-configure_pointer_acceleration(struct evdev_device *device)
+int
+evdev_device_init_pointer_acceleration(struct evdev_device *device)
 {
        device->pointer.filter =
                create_pointer_accelator_filter(
@@ -1090,7 +1090,7 @@ evdev_configure_device(struct evdev_device *device)
                has_keyboard = 1;
 
        if ((has_abs || has_rel) && has_button) {
-               if (configure_pointer_acceleration(device) == -1)
+               if (evdev_device_init_pointer_acceleration(device) == -1)
                        return -1;
 
                device->seat_caps |= EVDEV_DEVICE_POINTER;
index 6a1203f..d4b8ee6 100644 (file)
@@ -177,6 +177,9 @@ evdev_device_create(struct libinput_seat *seat,
                    const char *sysname,
                    const char *syspath);
 
+int
+evdev_device_init_pointer_acceleration(struct evdev_device *device);
+
 struct evdev_dispatch *
 evdev_touchpad_create(struct evdev_device *device);