mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-27 06:50:06 +01:00
touchpad: hook up pointer acceleration configuration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
cd6b5770b2
commit
1dfb248ab9
3 changed files with 7 additions and 9 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue