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 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