On Wed, Jan 08, 2014 at 02:50:11PM -0800, Ping Cheng wrote:
> wcmLinkTouchAndPen only assigned touch to tablet (pen) interface.
> New Intuos series requires another tool (pad in this case) on the
> same interface as touch to access touch tool as well. That is, touch
> tool should be assigned to wcmTouchDevice for its own common struct.

I tried to review this patch but I had a really hard time parsing the above
and my head is spinning from trying to grasp from the diff. Can you rephrase
what this does, it'll get easer to review then. sorry

Cheers,
   Peter

> 
> The use of IsTablet is necessary to guarantee we link pen and touch
> tools.
> 
> Signed-off-by: Ping Cheng <pi...@wacom.com>
> ---
>  src/wcmConfig.c | 21 ++++++++++++++++-----
>  1 file changed, 16 insertions(+), 5 deletions(-)
> 
> diff --git a/src/wcmConfig.c b/src/wcmConfig.c
> index 2d19944..6891ca6 100644
> --- a/src/wcmConfig.c
> +++ b/src/wcmConfig.c
> @@ -388,6 +388,11 @@ wcmInitModel(InputInfoPtr pInfo)
>  /**
>   * Link the touch tool to the pen of the same device
>   * so we can arbitrate the events when posting them.
> + * As a by-product, we also assign the touch tool to
> + * its own common wcmTouchDevice so other tool on the
> + * same interface can access it, such as those devices
> + * that have expresskeys (pad) and touch on the same
> + * interface like Bamboo and new Intuos series.
>   */
>  static void wcmLinkTouchAndPen(InputInfoPtr pInfo)
>  {
> @@ -406,18 +411,24 @@ static void wcmLinkTouchAndPen(InputInfoPtr pInfo)
>                       tmpcommon = tmppriv->common;
>  
>                       /* skip the same tool or already linked devices */
> -                     if ((tmppriv == priv) || tmpcommon->wcmTouchDevice)
> +                     if ((tmppriv == priv) ||
> +                         (tmpcommon->wcmTouchDevice && IsTablet(tmppriv)))
>                               continue;
>  
>                       if (tmpcommon->tablet_id == common->tablet_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))
> +                             {
>                                       tmpcommon->wcmTouchDevice = priv;
> +                                     common->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
> 

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&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