}
static void
-tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
+tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time,
+ bool ignore_motion)
{
- tp_gesture_detect_motion_gestures(tp, time);
+ if (!ignore_motion)
+ tp_gesture_detect_motion_gestures(tp, time);
}
static void
}
static void
-tp_gesture_post_gesture(struct tp_dispatch *tp, uint64_t time)
+tp_gesture_post_gesture(struct tp_dispatch *tp, uint64_t time,
+ bool ignore_motion)
{
if (tp->gesture.state == GESTURE_STATE_NONE)
tp_gesture_handle_state_none(tp, time);
if (tp->gesture.state == GESTURE_STATE_UNKNOWN)
- tp_gesture_handle_state_unknown(tp, time);
+ tp_gesture_handle_state_unknown(tp, time, ignore_motion);
if (tp->gesture.state == GESTURE_STATE_POINTER_MOTION)
tp_gesture_handle_state_pointer_motion(tp, time);
}
void
-tp_gesture_post_events(struct tp_dispatch *tp, uint64_t time)
+tp_gesture_post_events(struct tp_dispatch *tp, uint64_t time,
+ bool ignore_motion)
{
if (tp->gesture.finger_count == 0)
return;
tp_thumb_reset(tp);
if (tp->gesture.finger_count <= 4)
- tp_gesture_post_gesture(tp, time);
+ tp_gesture_post_gesture(tp, time, ignore_motion);
}
void
ignore_motion |= tp_tap_handle_state(tp, time);
ignore_motion |= tp_post_button_events(tp, time);
- if (ignore_motion ||
- tp->palm.trackpoint_active ||
- tp->dwt.keyboard_active) {
+ if (tp->palm.trackpoint_active || tp->dwt.keyboard_active) {
tp_edge_scroll_stop_events(tp, time);
tp_gesture_cancel(tp, time);
return;
}
+ if (ignore_motion) {
+ tp_edge_scroll_stop_events(tp, time);
+ tp_gesture_cancel(tp, time);
+ tp_gesture_post_events(tp, time, true);
+ return;
+ }
+
if (tp_edge_scroll_post_events(tp, time) != 0)
return;
- tp_gesture_post_events(tp, time);
+ tp_gesture_post_events(tp, time, false);
}
static void
tp_gesture_handle_state(struct tp_dispatch *tp, uint64_t time);
void
-tp_gesture_post_events(struct tp_dispatch *tp, uint64_t time);
+tp_gesture_post_events(struct tp_dispatch *tp, uint64_t time,
+ bool ignore_motion);
void
tp_gesture_stop_twofinger_scroll(struct tp_dispatch *tp, uint64_t time);