diff options
author | Jason Gerecke <killertofu@gmail.com> | 2011-11-14 13:04:24 -0800 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2011-11-15 11:21:46 -0800 |
commit | f7c0a64bf6550ac8ada19345bd03916bd4aa8890 (patch) | |
tree | 8a02b8a3542c8530141a1eec8235c84ce08f2e34 /src/wcmUSB.c | |
parent | 20958f84eef0b40f91e4559099f342f28650c183 (diff) | |
download | xf86-input-wacom-f7c0a64bf6550ac8ada19345bd03916bd4aa8890.tar.gz |
Fix usbInitToolType to not always return TOUCH_ID
Commit ca922994 changed usbInitToolType to use the tool
TOUCH_ID by default. Because of the way the 'for' loop just
below is handled though, the function would never return
anything but TOUCH_ID. This patch changes things to only
return TOUCH_ID if no data for an alternate tool type
could be found in the event packets.
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Diffstat (limited to 'src/wcmUSB.c')
-rw-r--r-- | src/wcmUSB.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wcmUSB.c b/src/wcmUSB.c index 14de990..4d05f67 100644 --- a/src/wcmUSB.c +++ b/src/wcmUSB.c @@ -1346,11 +1346,11 @@ static int usbParseBTNEvent(WacomCommonPtr common, * events to be processed. * @param nevents Number of events in the packet. * - * @return The tool type. 0 if no pen/touch/eraser event code in the event. + * @return The tool type. TOUCH_ID if no pen/touch/eraser event code in the event. */ static int usbInitToolType(const struct input_event *event_ptr, int nevents) { - int i, device_type = TOUCH_ID; + int i, device_type = 0; struct input_event* event = (struct input_event *)event_ptr; for (i = 0; (i < nevents) && !device_type; ++i) @@ -1378,6 +1378,11 @@ static int usbInitToolType(const struct input_event *event_ptr, int nevents) event++; } + if (!device_type) + { + device_type = TOUCH_ID; + } + return device_type; } |