[PATCH xf86-input-synaptics] Use maximum number of touches reported by evdev

Peter Hutterer peter.hutterer at who-t.net
Thu Apr 12 20:41:07 PDT 2012


On Mon, Apr 02, 2012 at 11:23:05AM -0700, Chase Douglas wrote:
> This resolves a regression from da461b91659d0c64aa6827e065aee2682116a57e
> where three touch tap and click actions on certain devices no longer
> work.
> 
> Some devices report a higher touch count than the number of touches they
> can provide data for. For example, many Synaptics touchpads can report
> up to five touches, but only provide data for two of them. We need to be
> able to report the correct number of touches for these devices when
> there are three touches. Using the maximum of the reported touch count
> and the number of touches provided ensures the count is accurate for all
> device types.
> 
> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>

merged, thanks.

Cheers,
  Peter

>  src/eventcomm.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/eventcomm.c b/src/eventcomm.c
> index 28d034f..3ceb98c 100644
> --- a/src/eventcomm.c
> +++ b/src/eventcomm.c
> @@ -624,11 +624,6 @@ static int count_fingers(InputInfoPtr pInfo, const struct CommData *comm)
>      struct eventcomm_proto_data *proto_data = priv->proto_data;
>      int fingers = 0;
>  
> -#ifdef HAVE_MULTITOUCH
> -    if (priv->has_touch)
> -        return proto_data->num_touches;
> -#endif
> -
>      if (comm->oneFinger)
>  	fingers = 1;
>      else if (comm->twoFingers)
> @@ -636,6 +631,11 @@ static int count_fingers(InputInfoPtr pInfo, const struct CommData *comm)
>      else if (comm->threeFingers)
>  	fingers = 3;
>  
> +#ifdef HAVE_MULTITOUCH
> +    if (priv->has_touch && proto_data->num_touches > fingers)
> +        fingers = proto_data->num_touches;
> +#endif
> +
>      return fingers;
>  }
>  
> -- 
> 1.7.9.1


More information about the xorg-devel mailing list