diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-18 09:30:17 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-18 09:38:13 +1000 |
commit | 12c287df894c88a1b2badf105ef625c7c67f334d (patch) | |
tree | 90af8614403f9ce737599ede577451189f232941 | |
parent | Accommodate for holes in the ABS label defines. (diff) | |
download | xf86-input-evdev-12c287df894c88a1b2badf105ef625c7c67f334d.tar.gz xf86-input-evdev-12c287df894c88a1b2badf105ef625c7c67f334d.tar.bz2 xf86-input-evdev-12c287df894c88a1b2badf105ef625c7c67f334d.zip |
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.c | 11 |
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 */ } } |