On Mon, Feb 24, 2014 at 01:31:56PM -0800, Jason Gerecke 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>
> Signed-off-by: Jason Gerecke <killert...@gmail.com>
> ---
> Changes from v4:
>  * None, aside from rebasing to apply on the prior patch

Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net>

Cheers,
   Peter

> 
>  src/wcmConfig.c | 23 +++++++++++++++++------
>  1 file changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git a/src/wcmConfig.c b/src/wcmConfig.c
> index e18613f..042890e 100644
> --- a/src/wcmConfig.c
> +++ b/src/wcmConfig.c
> @@ -464,8 +464,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.
>   *
>   * @return True if found a touch tool for hybrid devices.
>   * false otherwise.
> @@ -490,20 +492,29 @@ static Bool wcmLinkTouchAndPen(InputInfoPtr pInfo)
>               DBG(4, priv, "Considering link with %s...\n", tmppriv->name);
>  
>               /* already linked devices */
> -             if (tmpcommon->wcmTouchDevice)
> +             if (tmpcommon->wcmTouchDevice && IsTablet(tmppriv))
>               {
>                       DBG(4, priv, "A link is already in place. Ignoring.\n");
>                       continue;
>               }
>  
> -             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;
> +             }
>               else
> +             {
>                       DBG(4, priv, "A link is not necessary. Ignoring.\n");
> +             }
>  
> -             if (common->wcmTouchDevice || tmpcommon->wcmTouchDevice)
> +             if ((common->wcmTouchDevice && IsTablet(priv)) ||
> +                     (tmpcommon->wcmTouchDevice && IsTablet(tmppriv)))
>               {
>                       TabletSetFeature(common, WCM_PENTOUCH);
>                       TabletSetFeature(tmpcommon, WCM_PENTOUCH);
> -- 
> 1.9.0
> 
> 
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
> 

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&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