Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:07:36 -0000
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r346457 - in head: share/man/man4 sys/dev/atkbdc
Message-ID:  <201904202104.x3KL4uvl007824@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wulf
Date: Sat Apr 20 21:04:56 2019
New Revision: 346457
URL: https://svnweb.freebsd.org/changeset/base/346457

Log:
  psm(4): respect tap_disabled configuration with enabled Extended support
  
  This fixes a bug where, even when hw.psm.tap_enabled=0, touchpad taps
  were processed.
  tap_enabled has three states: unconfigured, disabled, and enabled (-1, 0, 1).
  To respect PR kern/139272, taps are ignored only when explicity disabled.
  
  Submitted by:	Ben LeMasurier <ben@crypt.ly> (initial version)
  MFC after:	2 weeks

Modified:
  head/share/man/man4/psm.4
  head/sys/dev/atkbdc/psm.c

Modified: head/share/man/man4/psm.4
==============================================================================
--- head/share/man/man4/psm.4	Sat Apr 20 21:02:41 2019	(r346456)
+++ head/share/man/man4/psm.4	Sat Apr 20 21:04:56 2019	(r346457)
@@ -354,8 +354,8 @@ Tap and drag gestures can be disabled by setting
 to
 .Em 0
 at boot-time.
-Currently, this is only supported on Synaptics touchpads with Extended
-support disabled.
+Currently, this is supported on Synaptics touchpads regardless of Extended
+support state and on Elantech touchpads with Extended support enabled.
 The behaviour may be changed after boot by setting
 the sysctl with the same name and by restarting
 .Xr moused 8

Modified: head/sys/dev/atkbdc/psm.c
==============================================================================
--- head/sys/dev/atkbdc/psm.c	Sat Apr 20 21:02:41 2019	(r346456)
+++ head/sys/dev/atkbdc/psm.c	Sat Apr 20 21:04:56 2019	(r346457)
@@ -3820,9 +3820,15 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i
 			gest->in_vscroll = 0;
 
 			/* Compute tap timeout. */
-			gest->taptimeout.tv_sec  = tap_timeout / 1000000;
-			gest->taptimeout.tv_usec = tap_timeout % 1000000;
-			timevaladd(&gest->taptimeout, &sc->lastsoftintr);
+			if (tap_enabled != 0) {
+				gest->taptimeout = (struct timeval) {
+					.tv_sec  = tap_timeout / 1000000,
+					.tv_usec = tap_timeout % 1000000,
+				};
+				timevaladd(
+				    &gest->taptimeout, &sc->lastsoftintr);
+			} else
+				timevalclear(&gest->taptimeout);
 
 			sc->flags |= PSM_FLAGS_FINGERDOWN;
 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904202104.x3KL4uvl007824>