git: e3201cec8381 - main - psm: Fix three finger tap on elantech v4 touchpads
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 01 Dec 2025 20:43:14 UTC
The branch main has been updated by wulf:
URL: https://cgit.FreeBSD.org/src/commit/?id=e3201cec8381c0582374f93991eff4a71bb95e9b
commit e3201cec8381c0582374f93991eff4a71bb95e9b
Author: Robert Wahlberg <freebsd@robertwahlberg.se>
AuthorDate: 2025-12-01 20:42:15 +0000
Commit: Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2025-12-01 20:42:15 +0000
psm: Fix three finger tap on elantech v4 touchpads
Fix an issue where a three finger tap would generate additional events
when fingers moved slightly during the tap.
Signed-off-by: Robert Wahlberg <freebsd@robertwahlberg.se>
Pull Request: https://github.com/freebsd/freebsd-src/pull/1792
Reviewed by: wulf
MFC after: 1 month
---
sys/dev/atkbdc/psm.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index 137758b104d3..d36396df0fa0 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -4666,6 +4666,13 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
mask = sc->elanaction.mask;
nfingers = bitcount(mask);
+ /* The motion packet can only update two fingers at a time.
+ * Copy the previous state to get all active fingers. */
+ for (id = 0; id < ELANTECH_MAX_FINGERS; id++)
+ if (sc->elanaction.mask & (1 << id))
+ f[id] = sc->elanaction.fingers[id];
+
+ /* Update finger positions from the new packet */
scale = (pb->ipacket[0] & 0x10) ? 5 : 1;
for (i = 0; i <= 3; i += 3) {
id = ((pb->ipacket[i] & 0xe0) >> 5) - 1;