summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-04-03 15:15:01 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-04-21 10:03:16 +1000
commit7d1a047b7c2f7acf6fdce5ac5d352bd909605234 (patch)
tree36c4d9cab02996e035853cd928bc97d50119b6f0 /src
parent76fce6cdddaee901ba47b1a47ecdc4e1e5e46f32 (diff)
touchpad: add helper function for stopping current actions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-mt-touchpad.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 21fdc46..f41dd68 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -276,6 +276,14 @@ tp_end_sequence(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time)
tp_end_touch(tp, t, time);
}
+static void
+tp_stop_actions(struct tp_dispatch *tp, uint64_t time)
+{
+ tp_edge_scroll_stop_events(tp, time);
+ tp_gesture_cancel(tp, time);
+ tp_tap_suspend(tp, time);
+}
+
struct normalized_coords
tp_get_delta(struct tp_touch *t)
{
@@ -1395,9 +1403,7 @@ tp_trackpoint_event(uint64_t time, struct libinput_event *event, void *data)
return;
if (!tp->palm.trackpoint_active) {
- tp_edge_scroll_stop_events(tp, time);
- tp_gesture_cancel(tp, time);
- tp_tap_suspend(tp, time);
+ tp_stop_actions(tp, time);
tp->palm.trackpoint_active = true;
}
@@ -1510,9 +1516,7 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data)
ARRAY_LENGTH(tp->dwt.mod_mask)))
return;
- tp_edge_scroll_stop_events(tp, time);
- tp_gesture_cancel(tp, time);
- tp_tap_suspend(tp, time);
+ tp_stop_actions(tp, time);
tp->dwt.keyboard_active = true;
timeout = DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT_1;
} else {