gestures: add a function to know if there is pending pointer motion

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
This commit is contained in:
José Expósito 2021-05-27 19:18:16 +02:00 committed by Peter Hutterer
parent 2599b0d899
commit bbc5aee5e5

View file

@ -154,6 +154,23 @@ tp_get_raw_pointer_motion(struct tp_dispatch *tp)
return raw;
}
static bool
tp_has_pending_pointer_motion(struct tp_dispatch *tp, uint64_t time)
{
struct device_float_coords raw;
if (!(tp->queued & TOUCHPAD_EVENT_MOTION))
return false;
/* Checking for raw pointer motion is enough in this case.
* Calling tp_filter_motion is intentionally omitted to avoid calling
* it twice (here and in tp_gesture_post_pointer_motion) with the same
* event.
*/
raw = tp_get_raw_pointer_motion(tp);
return !device_float_is_zero(raw);
}
static void
tp_gesture_post_pointer_motion(struct tp_dispatch *tp, uint64_t time)
{