diff options
author | Ping Cheng <pinglinux@gmail.com> | 2013-02-22 11:14:21 -0800 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2013-02-26 09:26:55 -0800 |
commit | dc5608a2911cf0698db1dd083250e37b4a31d58f (patch) | |
tree | 07250f6a4720b7d63b8ea838046dcb9dbf56486d | |
parent | 120f72f8f3fe5e74ed87c7ee3828243ba4ba054b (diff) | |
download | xf86-input-wacom-dc5608a2911cf0698db1dd083250e37b4a31d58f.tar.gz |
Support pen/touch arbitration across product ids
Devices with different product ids for pen and touch, such as
Cintiq 24HD and DTH 2242, were added recently. Applying arbitration
only for tools with same product id is not enough.
However, we want to make sure tools with same product id are lined
properly first. That's why the same routine is repeated instead of
combined.
Signed-off-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
-rw-r--r-- | src/wcmConfig.c | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/src/wcmConfig.c b/src/wcmConfig.c index 1c9eae7..cc3d9db 100644 --- a/src/wcmConfig.c +++ b/src/wcmConfig.c @@ -1,6 +1,6 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> - * Copyright 2002-2010 by Ping Cheng, Wacom. <pingc@wacom.com> + * Copyright 2002-2013 by Ping Cheng, Wacom. <pingc@wacom.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -396,20 +396,17 @@ static void wcmLinkTouchAndPen(InputInfoPtr pInfo) InputInfoPtr device = xf86FirstLocalDevice(); WacomCommonPtr tmpcommon = NULL; WacomDevicePtr tmppriv = NULL; - Bool touch_device_assigned = FALSE; - /* Lookup to find the associated pen and touch */ + /* Lookup to find the associated pen and touch with same product id */ for (; device != NULL; device = device->next) { if (!strcmp(device->drv->driverName, "wacom")) { tmppriv = (WacomDevicePtr) device->private; tmpcommon = tmppriv->common; - touch_device_assigned = (common->wcmTouchDevice || - tmpcommon->wcmTouchDevice); /* skip the same tool or already linked devices */ - if ((tmppriv == priv) || touch_device_assigned) + if ((tmppriv == priv) || tmpcommon->wcmTouchDevice) continue; if (tmpcommon->tablet_id == common->tablet_id) @@ -426,6 +423,37 @@ static void wcmLinkTouchAndPen(InputInfoPtr pInfo) TabletSetFeature(tmpcommon, WCM_PENTOUCH); } } + + if (common->wcmTouchDevice) + return; + } + } + + /* Lookup for pen and touch devices with different product ids */ + for (; device != NULL; device = device->next) + { + if (!strcmp(device->drv->driverName, "wacom")) + { + tmppriv = (WacomDevicePtr) device->private; + tmpcommon = tmppriv->common; + + /* skip the same tool or already linked devices */ + if ((tmppriv == priv) || tmpcommon->wcmTouchDevice) + continue; + + if (IsTouch(tmppriv) && IsTablet(priv)) + common->wcmTouchDevice = tmppriv; + else if (IsTouch(priv) && IsTablet(tmppriv)) + tmpcommon->wcmTouchDevice = priv; + + if (common->wcmTouchDevice || tmpcommon->wcmTouchDevice) + { + TabletSetFeature(common, WCM_PENTOUCH); + TabletSetFeature(tmpcommon, WCM_PENTOUCH); + } + + if (common->wcmTouchDevice) + return; } } } |