On Mon, Feb 3, 2014 at 4:21 PM, Ping Cheng <pingli...@gmail.com> wrote:
> To support arbitration, we only needed to access touch pointer
> from pen interfaces. Now, we need to access touch pointer from
> touch interfaces to update touch switch state.
>
> Since other tools, such as PAD, can be associated with touch
> interfaces, we can not assume the first tool created on touch
> interface is a touch tool. Assign it to wcmTouchDevice to avoid
> looping through the tool list everytime when we need to access it.
>
> Signed-off-by: Ping Cheng <pi...@wacom.com>
> ---
>  src/wcmConfig.c | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/src/wcmConfig.c b/src/wcmConfig.c
> index 103fc15..1d5442e 100644
> --- a/src/wcmConfig.c
> +++ b/src/wcmConfig.c
> @@ -386,8 +386,10 @@ wcmInitModel(InputInfoPtr pInfo)
>  }
>
>  /**
> - * Link the touch tool to the pen of the same device
> - * so we can arbitrate the events when posting them.
> + * Lookup to find the associated pen and touch for the same device.
> + * Store touch tool in wcmTouchDevice for pen and touch, respectively,
> + * of the same device. Update TabletFeature to indicate it is a hybrid
> + * of touch and pen.
>   *
>   * @param allow_different_id TRUE to check different product IDs
>   *
> @@ -412,18 +414,25 @@ static Bool wcmLinkTouchAndPen(InputInfoPtr pInfo, Bool 
> allow_different_id)
>                 tmpcommon = tmppriv->common;
>
>                 /* skip the same tool or already linked devices */
> -               if ((tmppriv == priv) || tmpcommon->wcmTouchDevice)
> +               if ((tmppriv == priv) || (tmpcommon->wcmTouchDevice && 
> IsTablet(tmppriv)))

As mentioned in patch 1, there was a problem which would allow bogus
connections between unrelated devices. This patch should be capable of
fixing it because it sets wcmTouchDevice on the touch interface.
However, you've diligently preserved behavior with this new "&&
IsTablet(tmppriv)" condition. Now, rather than bogus links occurring
because wcmTouchDevice isn't _set_ on touch devices, they're caused
because the status of wcmTouchDevice is _ignored_ on touch devices :D

I haven't been able to find a reason for this new "&&
IsTablet(tmppriv)" condition other than diligence to preserve the old
behavior. If that's the case, we should fix the bug (either in the
prior patch, or one between the prior one and this one) and drop this
new condition.

Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one  /
(That is to say, eight) to the two,     /
But you can’t take seven from three,    /
So you look at the sixty-fours....

>                         continue;
>
>                 if (((tmpcommon->tablet_id == common->tablet_id) && 
> !allow_different_id) ||
>                    ((tmpcommon->tablet_id == common->tablet_id) && 
> allow_different_id))
>                 {
> -                       if (IsTouch(tmppriv) && IsTablet(priv))
> +                       if (IsTouch(tmppriv))
> +                       {
>                                 common->wcmTouchDevice = tmppriv;
> -                       else if (IsTouch(priv) && IsTablet(tmppriv))
> +                               tmpcommon->wcmTouchDevice = tmppriv;
> +                       }
> +                       else if (IsTouch(priv))
> +                       {
> +                               common->wcmTouchDevice = priv;
>                                 tmpcommon->wcmTouchDevice = priv;
> +                       }
>
> -                       if (common->wcmTouchDevice || 
> tmpcommon->wcmTouchDevice)
> +                       if ((common->wcmTouchDevice && IsTablet(priv)) ||
> +                           (tmpcommon->wcmTouchDevice && IsTablet(tmppriv)))
>                         {
>                                 TabletSetFeature(common, WCM_PENTOUCH);
>                                 TabletSetFeature(tmpcommon, WCM_PENTOUCH);
> --
> 1.8.3.2
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to