mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-06 16:10:28 +01:00
touchpad: check fake finger count for validity
Setting TRIPLETAP unsets DOUBLETAP, etc. This doesn't usually happen with kernel devices, but every once in a while I get this wrong in a test and spend hours debugging the code... Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
ff2ee2c681
commit
7d5c35ccd0
1 changed files with 8 additions and 0 deletions
|
|
@ -140,6 +140,14 @@ tp_get_touch(struct tp_dispatch *tp, unsigned int slot)
|
|||
static inline unsigned int
|
||||
tp_fake_finger_count(struct tp_dispatch *tp)
|
||||
{
|
||||
/* Only one of BTN_TOOL_DOUBLETAP/TRIPLETAP/... may be set at any
|
||||
* time */
|
||||
if (__builtin_popcount(
|
||||
tp->fake_touches & ~(FAKE_FINGER_OVERFLOW|0x1)) > 1)
|
||||
log_bug_kernel(tp->device->base.seat->libinput,
|
||||
"Invalid fake finger state %#x\n",
|
||||
tp->fake_touches);
|
||||
|
||||
if (tp->fake_touches & FAKE_FINGER_OVERFLOW)
|
||||
return FAKE_FINGER_OVERFLOW;
|
||||
else /* don't count BTN_TOUCH */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue