mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-27 08:00:06 +01:00
touchpad: change clickfinger check distance function to a bool
And rename to make it more obvious what the return value will mean. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
parent
271dc496dc
commit
3dac359df3
1 changed files with 7 additions and 7 deletions
|
|
@ -926,13 +926,13 @@ tp_post_physical_buttons(struct tp_dispatch *tp, uint64_t time)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
tp_check_clickfinger_distance(struct tp_dispatch *tp,
|
||||
struct tp_touch *t1,
|
||||
struct tp_touch *t2)
|
||||
static inline bool
|
||||
tp_clickfinger_within_distance(struct tp_dispatch *tp,
|
||||
struct tp_touch *t1,
|
||||
struct tp_touch *t2)
|
||||
{
|
||||
double x, y;
|
||||
int within_distance = 0;
|
||||
bool within_distance = false;
|
||||
int xres, yres;
|
||||
int bottom_threshold;
|
||||
|
||||
|
|
@ -956,7 +956,7 @@ tp_check_clickfinger_distance(struct tp_dispatch *tp,
|
|||
if (x > 40 || y > 30)
|
||||
goto out;
|
||||
|
||||
within_distance = 1;
|
||||
within_distance = true;
|
||||
|
||||
/* if y spread is <= 20mm, they're definitely together. */
|
||||
if (y <= 20)
|
||||
|
|
@ -1014,7 +1014,7 @@ tp_clickfinger_set_button(struct tp_dispatch *tp)
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (tp_check_clickfinger_distance(tp, first, second))
|
||||
if (tp_clickfinger_within_distance(tp, first, second))
|
||||
nfingers = 2;
|
||||
else
|
||||
nfingers = 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue