summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rosca <nowrep@gmail.com>2019-02-25 18:26:08 +0100
committerDavid Rosca <nowrep@gmail.com>2019-02-25 18:43:42 +0100
commit8923d18d25303354f250b4f165fa66b327b8ac7e (patch)
tree3529f9385e72d4ea134538a84b53b4aeb3d38d87
parent055481187d44b10ba220398a1ca46f4854fd76ee (diff)
Also use type to match tablet tool with device
On devices with tools having both serial and id 0, it would fail to create separate subdevices. Thinkpad X220T (Wacom ISDv4 E6) now correctly registers Pen and Eraser xinput devices.
-rw-r--r--src/xf86libinput.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/xf86libinput.c b/src/xf86libinput.c
index ffe09be..5792224 100644
--- a/src/xf86libinput.c
+++ b/src/xf86libinput.c
@@ -1791,7 +1791,9 @@ xf86libinput_pick_device(struct xf86libinput_device *shared_device,
if (libinput_tablet_tool_get_serial(driver_data->tablet_tool) ==
libinput_tablet_tool_get_serial(tool) &&
libinput_tablet_tool_get_tool_id(driver_data->tablet_tool) ==
- libinput_tablet_tool_get_tool_id(tool))
+ libinput_tablet_tool_get_tool_id(tool) &&
+ libinput_tablet_tool_get_type(driver_data->tablet_tool) ==
+ libinput_tablet_tool_get_type(tool))
return driver_data->pInfo;
}
}
@@ -2111,13 +2113,15 @@ xf86libinput_find_device_for_tool(InputInfoPtr pInfo,
struct xf86libinput_device *shared_device = driver_data->shared_device;
uint64_t serial = libinput_tablet_tool_get_serial(tool);
uint64_t tool_id = libinput_tablet_tool_get_tool_id(tool);
+ enum libinput_event_type tool_type = libinput_tablet_tool_get_type(tool);
xorg_list_for_each_entry(dev,
&shared_device->device_list,
shared_device_link) {
if (dev->tablet_tool &&
libinput_tablet_tool_get_serial(dev->tablet_tool) == serial &&
- libinput_tablet_tool_get_tool_id(dev->tablet_tool) == tool_id) {
+ libinput_tablet_tool_get_tool_id(dev->tablet_tool) == tool_id &&
+ libinput_tablet_tool_get_type(dev->tablet_tool) == tool_type) {
return dev->pInfo->dev;
}
}