aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-20 11:42:35 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-21 15:51:08 +1000
commit3c43d880f13725a04fcd7c0c8d5978a36208e373 (patch)
tree8462743cdcbd51f7cf5ff84bb4f1cee2fbf834e2
parentUse xf86DisableDevice instead of the DIX' DisableDevice. (diff)
downloadxf86-input-evdev-3c43d880f13725a04fcd7c0c8d5978a36208e373.tar.gz
xf86-input-evdev-3c43d880f13725a04fcd7c0c8d5978a36208e373.tar.bz2
xf86-input-evdev-3c43d880f13725a04fcd7c0c8d5978a36208e373.zip
Only label axes and buttons if the device has axes or buttons.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 647278f..fca0b64 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2020,7 +2020,7 @@ EvdevInitProperty(DeviceIntPtr dev)
#ifdef HAVE_LABELS
/* Axis labelling */
- if ((prop_axis_label = XIGetKnownProperty(AXIS_LABEL_PROP)))
+ if ((pEvdev->num_vals > 0) && (prop_axis_label = XIGetKnownProperty(AXIS_LABEL_PROP)))
{
Atom atom, atoms[pEvdev->num_vals];
int natoms = pEvdev->num_vals;
@@ -2064,7 +2064,7 @@ EvdevInitProperty(DeviceIntPtr dev)
XISetDevicePropertyDeletable(dev, prop_axis_label, FALSE);
}
/* Button labelling */
- if ((prop_btn_label = XIGetKnownProperty(BTN_LABEL_PROP)))
+ if ((pEvdev->buttons > 0) && (prop_btn_label = XIGetKnownProperty(BTN_LABEL_PROP)))
{
Atom atom, atoms[pEvdev->buttons];
int button, bmap;