summaryrefslogtreecommitdiff
path: root/src/filter-touchpad.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2022-11-22 11:34:06 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2023-01-17 10:51:33 +1000
commitd199c6d8c1df9d5b39681f36ceac4445df9b3ce8 (patch)
tree9adb6ae277bf99dd9ac37312f4cfa5716fa21979 /src/filter-touchpad.c
parent1d7172488dcd4148ea7c89e120cd24018522842d (diff)
downloadlibinput-d199c6d8c1df9d5b39681f36ceac4445df9b3ce8.tar.gz
filter: add helper functions to create/destroy a delta smoothener
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/filter-touchpad.c')
-rw-r--r--src/filter-touchpad.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/filter-touchpad.c b/src/filter-touchpad.c
index cd51a7ea..c7e7ae9c 100644
--- a/src/filter-touchpad.c
+++ b/src/filter-touchpad.c
@@ -300,7 +300,6 @@ create_pointer_accelerator_filter_touchpad(int dpi,
bool use_velocity_averaging)
{
struct touchpad_accelerator *filter;
- struct pointer_delta_smoothener *smoothener;
filter = zalloc(sizeof *filter);
filter->last_velocity = 0.0;
@@ -312,11 +311,7 @@ create_pointer_accelerator_filter_touchpad(int dpi,
filter->base.interface = &accelerator_interface_touchpad;
filter->profile = touchpad_accel_profile_linear;
-
- smoothener = zalloc(sizeof(*smoothener));
- smoothener->threshold = event_delta_smooth_threshold,
- smoothener->value = event_delta_smooth_value,
- filter->trackers.smoothener = smoothener;
+ filter->trackers.smoothener = pointer_delta_smoothener_create(event_delta_smooth_threshold, event_delta_smooth_value);
return &filter->base;
}