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 3c43d880f1)
This commit is contained in:
Peter Hutterer
2009-05-20 11:42:35 +10:00
parent cf887a2b7c
commit 40d3ad3ac0

View File

@@ -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;