summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrey Zabolotnyi <zapparello@ya.ru>2018-01-15 01:32:42 +0300
committerPeter Hutterer <peter.hutterer@who-t.net>2018-01-16 16:30:59 +1000
commit192fdb06905f0f190e3a0e258919676934e6633c (patch)
tree23bb8697e02e6aad82497db4dc7039f79cddc573 /src
parent8c1058f2ebd9355068fb1b67329f3428ca64775b (diff)
Fix handling of devices with only buttons (e.g. tablet pads).
When transforming 'only buttons' device into a pseudo-mouse by adding relative X and Y axes, EVDEV_RELATIVE_EVENTS flag must be set on device, otherwise it gets classified as a keyboard by X11. https://bugs.freedesktop.org/show_bug.cgi?id=104630 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/evdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index f627fd0..cffed7f 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2353,8 +2353,10 @@ EvdevProbe(InputInfoPtr pInfo)
pInfo->type_name = XI_TOUCHSCREEN;
} else {
if (!libevdev_has_event_code(pEvdev->dev, EV_REL, REL_X) ||
- !libevdev_has_event_code(pEvdev->dev, EV_REL, REL_Y))
+ !libevdev_has_event_code(pEvdev->dev, EV_REL, REL_Y)) {
+ pEvdev->flags |= EVDEV_RELATIVE_EVENTS;
EvdevForceXY(pInfo, Relative);
+ }
xf86IDrvMsg(pInfo, X_INFO, "Configuring as mouse\n");
pInfo->type_name = XI_MOUSE;
}