Bug 104630

Summary: evdev driver incorrectly handles devices with only buttons
Product: xorg Reporter: Andrey Zabolotnyi <zapparello>
Component: Input/evdevAssignee: Peter Hutterer <peter.hutterer>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: peter.hutterer
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
proposed fix none

Description Andrey Zabolotnyi 2018-01-14 22:45:17 UTC
Created attachment 136719 [details] [review]
proposed fix

When a input device with only buttons is present (e.g. BTN_0..BTN_9), in Xorg.log I can see the following:

evdev: Huion HA60-F400 Tablet Pad: Device: "/dev/input/event3"
evdev: Huion HA60-F400 Tablet Pad: Vendor 0x256c Product 0x6e
evdev: Huion HA60-F400 Tablet Pad: Found 16 mouse buttons
evdev: Huion HA60-F400 Tablet Pad: Forcing relative x/y axes to exist.
evdev: Huion HA60-F400 Tablet Pad: Configuring as mouse
evdev: Huion HA60-F400 Tablet Pad: YAxisMapping: buttons 4 and 5
evdev: Huion HA60-F400 Tablet Pad: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200

However, "xinput list" will show the device listed as a slave of "Virtual core keyboard". As a consequence, GIMP fails to show this device in the "extended input device" dialog (don't ask me why) and Plasma5 crashes when you do "xinput test <device>" (also don't ask me why). Anyways, if it is "Configuring as mouse", I would expect it to be a slave of "Virtual core pointer".

A inspection of the evdev driver revealed a small mistake: the relative X and Y axes are added to the device, but EVDEV_RELATIVE_EVENTS flag is not set. This leads to the above described effects.

The small attached patch fixes this.
Comment 1 Peter Hutterer 2018-01-16 06:33:33 UTC
Pushed as 192fdb06905f0f190e3a0e258919676934e6633c, 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.