Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Dec 2015 11:13:51 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r292197 - head/sys/dev/atkbdc
Message-ID:  <201512141113.tBEBDpZV054983@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Mon Dec 14 11:13:50 2015
New Revision: 292197
URL: https://svnweb.freebsd.org/changeset/base/292197

Log:
  When exiting two-finger scroll the Synaptics device may report a jump in
  absolute position. This seems to be correlated with only removing a single
  finger. To work around this report no movement on from the first packet
  when the user exits scrolling.

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==============================================================================
--- head/sys/dev/atkbdc/psm.c	Mon Dec 14 10:31:03 2015	(r292196)
+++ head/sys/dev/atkbdc/psm.c	Mon Dec 14 11:13:50 2015	(r292197)
@@ -2841,6 +2841,7 @@ proc_synaptics(struct psm_softc *sc, pac
 		int two_finger_scroll;
 		int len, weight_prev_x, weight_prev_y;
 		int div_max_x, div_max_y, div_x, div_y;
+		int exiting_scroll;
 
 		/* Read sysctl. */
 		/* XXX Verify values? */
@@ -2867,6 +2868,8 @@ proc_synaptics(struct psm_softc *sc, pac
 		vscroll_ver_area = sc->syninfo.vscroll_ver_area;
 		two_finger_scroll = sc->syninfo.two_finger_scroll;
 
+		exiting_scroll = 0;
+
 		/* Palm detection. */
 		if (!(
 		    ((sc->synhw.capMultiFinger ||
@@ -3068,8 +3071,10 @@ proc_synaptics(struct psm_softc *sc, pac
 		 * Reset two finger scrolling when the number of fingers
 		 * is different from two.
 		 */
-		if (two_finger_scroll && w != 0)
+		if (two_finger_scroll && w != 0 && synaction->in_vscroll != 0) {
 			synaction->in_vscroll = 0;
+			exiting_scroll = 1;
+		}
 
 		VLOG(5, (LOG_DEBUG,
 			"synaptics: virtual scrolling: %s "
@@ -3177,6 +3182,10 @@ proc_synaptics(struct psm_softc *sc, pac
 			/* The pointer is not moved. */
 			*x = *y = 0;
 		} else {
+			/* On exit the x/y pos may jump, ignore this */
+			if (exiting_scroll)
+				*x = *y = 0;
+
 			VLOG(3, (LOG_DEBUG, "synaptics: [%d, %d] -> [%d, %d]\n",
 			    dx, dy, *x, *y));
 		}



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