[PATCH 12/18] Add pinch gesture support
Chris Bagwell
chris at cnpbagwell.com
Thu Oct 14 09:45:17 PDT 2010
On Fri, Oct 8, 2010 at 12:22 PM, Takashi Iwai <tiwai at suse.de> wrote:
> + static void
> +handle_multi_touch_pinch(SynapticsPrivate *priv, struct SynapticsHwState *hw,
> + int *zoom_in, int *zoom_out)
> +{
> + SynapticsParameters *para = &priv->synpara;
> + int width = abs(priv->maxx - priv->minx);
> + int dist, dist_diff, abs_diff;
> +
> + *zoom_in = *zoom_out = 0;
> +
> + if (hw->multi_touch <= 1 || hw->numFingers < 2 ||
> + (priv->multi_touch_mode < MULTI_TOUCH_MODE_GESTURE &&
> + priv->multi_touch_mode != MULTI_TOUCH_MODE_START))
> + return; /* no multi-touch or in other mode */
> + if (para->multi_touch_pinch_dist <= 0 ||
> + para->multi_touch_pinch_start <= 0)
> + return; /* pinch disabled */
> +
When I've implemented gesture logic in the past, I've ran into issues
with 2-finger scrolling and pinch zoom-out looking similar; especially
if user is scrolling in a V pattern and so moving apart as they go.
I bring this up because I didn't notice anything in patch to prevent
the older ST 2-finger scrolling logic from kicking in. Isn't it
needed?
Also, should that numFingers < 2 be numFingers == 2 to prevent
confusion with 3 finger gesture in later patch? Especially in 3
finger that is V pattern as well.
Chris
More information about the xorg-devel
mailing list