aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/atkbdc
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2019-04-20 21:02:41 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2019-04-20 21:02:41 +0000
commit51319286ed34e70b00a709ac36a1120c26d95a5d (patch)
treeca502bd6f95962866224a95ebba0796146af3f83 /sys/dev/atkbdc
parent232e4318b0a349d63ecb4208c9f8e2e14d57004b (diff)
downloadsrc-51319286ed34e70b00a709ac36a1120c26d95a5d.tar.gz
src-51319286ed34e70b00a709ac36a1120c26d95a5d.zip
psm(4): do not process gestures when palm is present
Ignoring of gesture processing when the palm is detected helps to reduce some of the erratic pointer behavior. This fixes regression introduced in r317814 Reported by: Ben LeMasurier <ben@crypt.ly> MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=346456
Diffstat (limited to 'sys/dev/atkbdc')
-rw-r--r--sys/dev/atkbdc/psm.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index 10f6a0a0e10d..f1c9c07e85cf 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -3214,7 +3214,7 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
static int guest_buttons;
static int ew_finger_count;
static finger_t f[PSM_FINGERS];
- int w, id, nfingers, ewcode, extended_buttons, clickpad_pressed;
+ int w, id, nfingers, palm, ewcode, extended_buttons, clickpad_pressed;
extended_buttons = 0;
@@ -3577,12 +3577,16 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
ms->button = touchpad_buttons;
- psmgestures(sc, &f[0], nfingers, ms);
+ palm = psmpalmdetect(sc, &f[0], nfingers);
+
+ /* Palm detection doesn't terminate the current action. */
+ if (!palm)
+ psmgestures(sc, &f[0], nfingers, ms);
+
for (id = 0; id < PSM_FINGERS; id++)
psmsmoother(sc, &f[id], id, ms, x, y);
- /* Palm detection doesn't terminate the current action. */
- if (psmpalmdetect(sc, &f[0], nfingers)) {
+ if (palm) {
*x = *y = *z = 0;
ms->button = ms->obutton;
return (0);
@@ -4324,7 +4328,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
{
static int touchpad_button, trackpoint_button;
finger_t fn, f[ELANTECH_MAX_FINGERS];
- int pkt, id, scale, i, nfingers, mask;
+ int pkt, id, scale, i, nfingers, mask, palm;
if (!elantech_support)
return (0);
@@ -4713,10 +4717,14 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
ms->button = touchpad_button | trackpoint_button;
+ /* Palm detection doesn't terminate the current action. */
+ palm = psmpalmdetect(sc, &f[0], nfingers);
+
/* Send finger 1 position to gesture processor */
- if (PSM_FINGER_IS_SET(f[0]) || PSM_FINGER_IS_SET(f[1]) ||
- nfingers == 0)
+ if ((PSM_FINGER_IS_SET(f[0]) || PSM_FINGER_IS_SET(f[1]) ||
+ nfingers == 0) && !palm)
psmgestures(sc, &f[0], imin(nfingers, 3), ms);
+
/* Send fingers positions to movement smoothers */
for (id = 0; id < PSM_FINGERS; id++)
if (PSM_FINGER_IS_SET(f[id]) || !(mask & (1 << id)))
@@ -4731,8 +4739,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
}
sc->elanaction.mask = mask;
- /* Palm detection doesn't terminate the current action. */
- if (psmpalmdetect(sc, &f[0], nfingers)) {
+ if (palm) {
*x = *y = *z = 0;
ms->button = ms->obutton;
return (0);