From c992a92c0f39e755141eaf262b3f597908708764 Mon Sep 17 00:00:00 2001 From: Simon Thum Date: Thu, 10 Feb 2011 12:02:39 +0100 Subject: [PATCH 1/3] add a few comments to ComputeDeltas() Signed-off-by: Simon Thum --- src/synaptics.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/synaptics.c b/src/synaptics.c index d57a75a..b030127 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -1746,6 +1746,9 @@ static int hysteresis(int in, int center, int margin) { return center + diff; } +/* + * Compute relative motion ('deltas') including edge motion xor trackstick. + */ static int ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState *hw, edge_type edge, int *dxP, int *dyP, Bool inside_area) @@ -1779,9 +1782,11 @@ ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState *hw, !priv->vert_scroll_edge_on && !priv->horiz_scroll_edge_on && !priv->vert_scroll_twofinger_on && !priv->horiz_scroll_twofinger_on && !priv->circ_scroll_on && priv->prevFingers == hw->numFingers) { - /* FIXME: Wtf?? what's with 13? */ - delay = MIN(delay, 13); - if (priv->count_packet_finger > 3) { /* min. 3 packets */ + /* to create fluid edge motion, call back 'soon' + * even in the absence of new hardware events */ + delay = 13; + + if (priv->count_packet_finger > 3) { /* min. 3 packets, see below */ double tmpf; int x_edge_speed = 0; int y_edge_speed = 0; @@ -1794,6 +1799,7 @@ ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState *hw, dx = dx * dtime * para->trackstick_speed; dy = dy * dtime * para->trackstick_speed; } else if (moving_state == MS_TOUCHPAD_RELATIVE) { + /* 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); -- 1.7.3.4