summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-02-18 09:30:17 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-02-18 09:38:13 +1000
commit12c287df894c88a1b2badf105ef625c7c67f334d (patch)
tree90af8614403f9ce737599ede577451189f232941
parent9f1b9aa6eb81087b3df12184eafb104c0e745f41 (diff)
Label axes conditional on actual support.
Server 1.6 has device properties, but not axis labels. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index a6e6583..73291d7 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -49,6 +49,13 @@
#include <X11/Xatom.h>
#include <evdev-properties.h>
#include <xserver-properties.h>
+/* 1.6 has properties, but no labels */
+#ifdef AXIS_LABEL_PROP
+#define HAVE_LABELS
+#else
+#undef HAVE_LABELS
+#endif
+
#endif
#ifndef MAXDEVICES
@@ -1684,6 +1691,7 @@ EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code)
}
#ifdef HAVE_PROPERTIES
+#ifdef HAVE_LABELS
/* Aligned with linux/input.h.
Note that there are holes in the ABS_ range, these are simply replaced with
MISC here */
@@ -1735,6 +1743,7 @@ static char* rel_labels[] = {
AXIS_LABEL_PROP_REL_WHEEL,
AXIS_LABEL_PROP_REL_MISC
};
+#endif /* HAVE_LABELS */
static void
@@ -1791,6 +1800,7 @@ EvdevInitProperty(DeviceIntPtr dev)
XISetDevicePropertyDeletable(dev, prop_swap, FALSE);
+#ifdef HAVE_LABELS
/* Axis labelling */
if ((prop_label = XIGetKnownProperty(AXIS_LABEL_PROP)))
{
@@ -1835,6 +1845,7 @@ EvdevInitProperty(DeviceIntPtr dev)
PropModeReplace, natoms, &atoms, FALSE);
XISetDevicePropertyDeletable(dev, prop_label, FALSE);
}
+#endif /* HAVE_LABELS */
}
}