summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-02-09 16:22:35 -0800
committerPeter Hutterer <peter.hutterer@who-t.net>2012-03-13 16:18:31 +1000
commitdefc1d008e5674306a7e9b9cb0c750d9787990b7 (patch)
tree9e9e6a094bd4feb10c241ee38678c75e1712bb3a
parent7f5bd79b2e361a89a8c2716c218e4ae70b7164b8 (diff)
Don't use linear regression when calculating touchpad motion deltas
The results depend on the data rate of the device. A device with a higher data rate, and thus lower individual deltas, will behave differently with the regression calculation. This can be verified on Synaptics semi-mt clickpads. The data rate is halved when two or more touches are on the device. When trying to press a button and drag the cursor with another touch, the motion will feel faster than dragging with only one touch on the device. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/synaptics.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 39ba92b..2ddb733 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1972,9 +1972,8 @@ get_delta(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
int x_edge_speed = 0;
int y_edge_speed = 0;
- /* HIST is full enough: priv->count_packet_finger > 3 */
- *dx = estimate_delta(hw->x, HIST(0).x, HIST(1).x, HIST(2).x);
- *dy = estimate_delta(hw->y, HIST(0).y, HIST(1).y, HIST(2).y);
+ *dx = hw->x - HIST(0).x;
+ *dy = hw->y - HIST(0).y;
if ((priv->tap_state == TS_DRAG) || para->edge_motion_use_always)
get_edge_speed(priv, hw, edge, &x_edge_speed, &y_edge_speed);
@@ -2043,7 +2042,7 @@ ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
* POLL_MS declaration. */
delay = MIN(delay, POLL_MS);
- if (priv->count_packet_finger <= 3) /* min. 3 packets, see get_delta() */
+ if (priv->count_packet_finger <= 1)
goto out; /* skip the lot */
if (priv->moving_state == MS_TRACKSTICK)