summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseExposito <jose.exposito89@gmail.com>2021-04-07 17:50:56 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2021-04-13 14:01:11 +1000
commit020f13e10d06193d2d3a1fa09c8e9ca99302527a (patch)
treea64d7c983ca025554a7c94d508900bf68664aa03 /src
parent82da751726b7038e347be5377c3ebf468e6b5770 (diff)
gestures: move the code to get raw pointer motion to its own function
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-mt-touchpad-gestures.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index c50fa963..57df44a2 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -138,11 +138,10 @@ tp_gesture_start(struct tp_dispatch *tp, uint64_t time)
tp->gesture.started = true;
}
-static void
-tp_gesture_post_pointer_motion(struct tp_dispatch *tp, uint64_t time)
+static struct device_float_coords
+tp_get_raw_pointer_motion(struct tp_dispatch *tp)
{
struct device_float_coords raw;
- struct normalized_coords delta;
/* When a clickpad is clicked, combine motion of all active touches */
if (tp->buttons.is_clickpad && tp->buttons.state)
@@ -150,6 +149,16 @@ tp_gesture_post_pointer_motion(struct tp_dispatch *tp, uint64_t time)
else
raw = tp_get_average_touches_delta(tp);
+ return raw;
+}
+
+static void
+tp_gesture_post_pointer_motion(struct tp_dispatch *tp, uint64_t time)
+{
+ struct device_float_coords raw;
+ struct normalized_coords delta;
+
+ raw = tp_get_raw_pointer_motion(tp);
delta = tp_filter_motion(tp, &raw, time);
if (!normalized_is_zero(delta) || !device_float_is_zero(raw)) {