diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-20 11:42:35 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-30 09:44:33 +1000 |
commit | 40d3ad3ac00fc21f2561c906d1246648a9f74087 (patch) | |
tree | e9043fbedf5a8155dfd96ecbd8fee4ee7fc1af53 /src/evdev.c | |
parent | evdev 2.2.2 (diff) | |
download | xf86-input-evdev-40d3ad3ac00fc21f2561c906d1246648a9f74087.tar.gz xf86-input-evdev-40d3ad3ac00fc21f2561c906d1246648a9f74087.tar.bz2 xf86-input-evdev-40d3ad3ac00fc21f2561c906d1246648a9f74087.zip |
Only label axes and buttons if the device has axes or buttons.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3c43d880f13725a04fcd7c0c8d5978a36208e373)
Diffstat (limited to 'src/evdev.c')
-rw-r--r-- | src/evdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evdev.c b/src/evdev.c index 9fc0663..fc4832b 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1982,7 +1982,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; @@ -2026,7 +2026,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; |