Bug 14011 - evdev breaks if input device provides ABS X or Y without TOUCH button
Summary: evdev breaks if input device provides ABS X or Y without TOUCH button
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/evdev (show other bugs)
Version: 7.3 (2007.09)
Hardware: x86 (IA32) All
: medium major
Assignee: Zephaniah E. Hull
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-10 10:50 UTC by Philip Langdale
Modified: 2008-01-30 23:10 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to handle absolute devices without a TOUCH button (514 bytes, patch)
2008-01-10 10:51 UTC, Philip Langdale
no flags Details | Splinter Review

Description Philip Langdale 2008-01-10 10:50:58 UTC
I finally got around to testing the VMware virtual absolute usb mouse with the latest version of evdev, and unfortunately it doesn't work again.

The reason is that evdev is assuming that if a device provides the X or Y axes, it will be a tablet with the ABSOLUTE_TOUCH button and that motion events should only be acknowledged if the touch 'button' is pressed. Frustratingly, evdev already has code to notice that the touch button is absent but it doesn't check when receiving motion events.

I'm attaching a patch so that the motion event code checks for the flag that is set when the button is detected.

With this patch, the VMware mouse works correctly.
Comment 1 Philip Langdale 2008-01-10 10:51:56 UTC
Created attachment 13647 [details] [review]
Patch to handle absolute devices without a TOUCH button

I can check this in once its approved.
Comment 2 Zephaniah E. Hull 2008-01-10 11:05:16 UTC
This patch is wrong.

Why is EV_ABS_V_USE_TOUCH getting set on the device at all?
Comment 3 Philip Langdale 2008-01-10 11:11:13 UTC
See EvdevParseAbsOptions:

If the "use_touch" option is set for the axis, then EV_ABS_V_USE_TOUCH will be set for that axis.

Then in EvdevAxisAbsNew, if the axis is ABS_X or ABS_Y, the "use_touch" option is set.

Then in EvdevAxisAbsNew1, it checks for the AbsoluteTouch button and if it is present, it sets (state->abs->flags |= EV_ABS_USE_TOUCH)

So, within that context, I added the addition check for EV_ABS_USE_TOUCH.

Of course, if you think all the stuff is bogus, the fix will look different.
Comment 4 Philip Langdale 2008-01-17 14:48:37 UTC
any comments?
Comment 5 Vinay Bondhugula 2008-01-30 23:10:51 UTC
Checked in a fix that clears the EV_ABS_V_USE_TOUCH for the X and Y axes if the device does not have a touch button.

Thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.