mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-08 13:38:40 +02:00
gestures: move the code to get raw pointer motion to its own function
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
This commit is contained in:
parent
82da751726
commit
020f13e10d
1 changed files with 12 additions and 3 deletions
|
|
@ -138,11 +138,10 @@ tp_gesture_start(struct tp_dispatch *tp, uint64_t time)
|
||||||
tp->gesture.started = true;
|
tp->gesture.started = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static struct device_float_coords
|
||||||
tp_gesture_post_pointer_motion(struct tp_dispatch *tp, uint64_t time)
|
tp_get_raw_pointer_motion(struct tp_dispatch *tp)
|
||||||
{
|
{
|
||||||
struct device_float_coords raw;
|
struct device_float_coords raw;
|
||||||
struct normalized_coords delta;
|
|
||||||
|
|
||||||
/* When a clickpad is clicked, combine motion of all active touches */
|
/* When a clickpad is clicked, combine motion of all active touches */
|
||||||
if (tp->buttons.is_clickpad && tp->buttons.state)
|
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
|
else
|
||||||
raw = tp_get_average_touches_delta(tp);
|
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);
|
delta = tp_filter_motion(tp, &raw, time);
|
||||||
|
|
||||||
if (!normalized_is_zero(delta) || !device_float_is_zero(raw)) {
|
if (!normalized_is_zero(delta) || !device_float_is_zero(raw)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue