diff options
author | Jason Gerecke <killertofu@gmail.com> | 2017-12-21 10:03:19 -0800 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2018-01-04 15:21:22 -0800 |
commit | 6b68d40f6047e23651616403d5ff7ee563f42418 (patch) | |
tree | f4870378ef914e607c2b91e564e6f8dc5d02a86b | |
parent | 21f498ef8b4ac826c6873ce9d54edcee313a0844 (diff) | |
download | xf86-input-wacom-6b68d40f6047e23651616403d5ff7ee563f42418.tar.gz |
Be more strict about linking to already-linked devices
The wcmLinkTouchAndPen function is responsible for associating the pen and
touch interfaces of a tablet. This association can be tripped up if multiple
devices with the same name are connected, so it includes code to prevent
linking to a device which already has been linked up. However, the condition
also checks that the device being considered is a tablet (i.e., stylus/eraser/
cursor; not pad/touch). This latter check seems nonsensical: it allows devices
to link to the first touch device they find, even if that device is already
linked up.
Disallowing multiple links to the same device prevents all three pen/touch/pad
devices from having wcmTouchDevice set up, however. Leaving the stricter
condition as-is could cause devices to be linked up incorrectly (e.g. if the
X server has {touch1, pen1, pad1, touch2, pen2, pad2}, then touch1 and pen1
would get linked, but pad1 and touch2 would get linked, and pen2/pad2 left
unlinked!). To prevent this, we disallow linking of pad interfaces, which
should not be a problem since the pad shouldn't need to use the wcmTouchDevice
variable.
Fixes: 8bb519ef2b ("Update wcmTouchDevice for touch interface")
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r-- | src/wcmConfig.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wcmConfig.c b/src/wcmConfig.c index 2402952..f85f1ca 100644 --- a/src/wcmConfig.c +++ b/src/wcmConfig.c @@ -492,6 +492,12 @@ static Bool wcmLinkTouchAndPen(InputInfoPtr pInfo) WacomCommonPtr tmpcommon = NULL; WacomDevicePtr tmppriv = NULL; + if (IsPad(priv)) + { + DBG(4, priv, "No need to link up pad devices.\n"); + return FALSE; + } + /* Lookup to find the associated pen and touch */ for (; device != NULL; device = device->next) { @@ -504,7 +510,7 @@ static Bool wcmLinkTouchAndPen(InputInfoPtr pInfo) DBG(4, priv, "Considering link with %s...\n", tmppriv->name); /* already linked devices */ - if (tmpcommon->wcmTouchDevice && IsTablet(tmppriv)) + if (tmpcommon->wcmTouchDevice) { DBG(4, priv, "A link is already in place. Ignoring.\n"); continue; |