diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-02-09 16:56:29 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-03-14 08:47:05 +1000 |
commit | c546779b32d8be23475b3b062e3ebc9235365c0d (patch) | |
tree | 295d0d94a89a97ed16cd95129f947f801f54f794 | |
parent | 405f1643e26b57ee97063e76e71179ba8e9fbc92 (diff) |
Ignore motion during touch count changes on semi-mt devices
Semi-mt devices do not track touches. The locations of touches are
unknown, we only have the bounding box of two of them. When 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>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/synaptics.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index 1164918..4275d2a 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -1598,6 +1598,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); SynapticsCopyHwState(priv->old_hw_state, priv->hwState); |