[xf86-input-synaptics,v3,10/10] Ignore motion during touch count changes on semi-mt devices

Submitted by Chase Douglas on Feb. 23, 2012, 9:02 p.m.

Details

Message ID 1330030945-573-11-git-send-email-chase.douglas@canonical.com
State Accepted
Headers show

Not browsing as part of any series.

Commit Message

Chase Douglas Feb. 23, 2012, 9:02 p.m.
Semi-mt devices do not track touches. The locations of touches are
unknown, we only have the bounding box of two of them. We the number of
fingers changes, the bounding box coordinates may change as well, but
the cumulative relative motion updates at that instant are invalid.

To work around this, ignore changes in cumulative relative motion if the
touch count changes.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
---
 src/synaptics.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/synaptics.c b/src/synaptics.c
index 5a92f94..139f237 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1588,6 +1588,14 @@  ReadInput(InputInfoPtr pInfo)
     SynapticsResetTouchHwState(hw);
 
     while (SynapticsGetHwState(pInfo, priv, hw)) {
+	/* Semi-mt device touch slots do not track touches. When there is a
+	 * change in the number of touches, we must disregard the temporary
+	 * motion changes. */
+	if (priv->has_semi_mt && hw->numFingers != priv->hwState->numFingers) {
+	    hw->cumulative_dx = priv->hwState->cumulative_dx;
+	    hw->cumulative_dy = priv->hwState->cumulative_dy;
+	}
+
 	SynapticsCopyHwState(priv->hwState, hw);
 	delay = HandleState(pInfo, hw, hw->millis, FALSE);
 	newDelay = TRUE;