summaryrefslogtreecommitdiff
path: root/src/evdev-mt-touchpad.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/evdev-mt-touchpad.c')
-rw-r--r--src/evdev-mt-touchpad.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 6f834fb1..aa65ab40 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -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 */
@@ -510,7 +518,7 @@ tp_pin_fingers(struct tp_dispatch *tp)
}
int
-tp_touch_active(struct tp_dispatch *tp, struct tp_touch *t)
+tp_touch_active(const struct tp_dispatch *tp, const struct tp_touch *t)
{
return (t->state == TOUCH_BEGIN || t->state == TOUCH_UPDATE) &&
t->palm.state == PALM_NONE &&
@@ -521,7 +529,7 @@ tp_touch_active(struct tp_dispatch *tp, struct tp_touch *t)
}
bool
-tp_palm_tap_is_palm(struct tp_dispatch *tp, struct tp_touch *t)
+tp_palm_tap_is_palm(const struct tp_dispatch *tp, const struct tp_touch *t)
{
if (t->state != TOUCH_BEGIN)
return false;