[PATCH 08/18] Avoid unexpected jumps
Peter Hutterer
peter.hutterer at who-t.net
Tue Oct 12 20:13:00 PDT 2010
On Fri, Oct 08, 2010 at 07:22:32PM +0200, Takashi Iwai wrote:
> Limit the movement size for avoiding the unexpected pointer jumps.
what pointer jumps? this patch really needs more explaining on how these
jumps happen, under what conditions, etc. simply limiting on a fixed set is
not enough.
any solution like this walks the blurry line between dropping coordinates
and unexpected jumps, and neither is really acceptable (the first one
definitely isn't). going 1/5 of the touchpad in one movement isn't actually
hard, my finger is about 1/4 the width of my touchpad, so just moving the
finger a little bit easily covers more than 1/5 (and yes, that's normal
movement).
a driver solution to this that tries to cater for touchpad movement also
completely ignores pointer acceleration. a user may have the pointer slowed
down to a point where even 1/2 the size of a touchpad is a normal movement.
Cheers,
Peter
> Signed-off-by: Takashi Iwai <tiwai at suse.de>
> ---
> src/synaptics.c | 10 ++++++++++
> src/synapticsstr.h | 1 +
> 2 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/src/synaptics.c b/src/synaptics.c
> index 3ba918a..bd52730 100644
> --- a/src/synaptics.c
> +++ b/src/synaptics.c
> @@ -467,6 +467,8 @@ static void set_default_parameters(InputInfoPtr pInfo)
> edgeMotionMaxSpeed = diag * .080;
> accelFactor = 200.0 / diag; /* trial-and-error */
>
> + priv->move_ptr_threshold = width / 5;
> +
> range = priv->maxp - priv->minp;
>
> /* scaling based on defaults and a pressure of 256 */
> @@ -1949,6 +1951,14 @@ ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
> break;
> }
> }
> +
> + if (moving_state && priv->count_packet_finger > 0 &&
> + priv->move_ptr_threshold > 0 ) {
> + int d = move_distance(HIST(0).x - hw->x, HIST(0).y - hw->y);
> + if (d > priv->move_ptr_threshold)
> + priv->count_packet_finger = 0; /* to avoid unexpected jumps */
> + }
> +
> if (inside_area && moving_state && !priv->palm &&
> !priv->vert_scroll_edge_on && !priv->horiz_scroll_edge_on &&
> !priv->vert_scroll_twofinger_on && !priv->horiz_scroll_twofinger_on &&
> diff --git a/src/synapticsstr.h b/src/synapticsstr.h
> index 44140f2..44925e5 100644
> --- a/src/synapticsstr.h
> +++ b/src/synapticsstr.h
> @@ -245,6 +245,7 @@ typedef struct _SynapticsPrivateRec
> unsigned int clickpad_threshold;
> int clickpad_dx, clickpad_dy;
> struct SynapticsHwState prev_hw; /* previous h/w state (for clickpad) */
> + int move_ptr_threshold;
> int prop_change_pending;
> Bool led_touch_state;
> Bool led_tapped;
> --
> 1.7.3.1
>
More information about the xorg-devel
mailing list