summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-02-09 16:56:29 -0800
committerChase Douglas <chase.douglas@canonical.com>2012-03-02 12:07:49 -0800
commitfbda6b6fe140c1dae9fb3bc7aaf9da4ea33a84a9 (patch)
tree5617ab11c01e1ee14c9eddf72703181743ded2dd
parentf8a73c54b4cb5116c6e23d646bae0ea5061debfc (diff)
Ignore motion during touch count changes on semi-mt devicesclickpad-v2
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>
-rw-r--r--src/synaptics.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index e80dff8..ff3c32e 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1589,6 +1589,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;