summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-17 13:59:43 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-07-17 13:59:49 +1000
commitdab0c2742c034750e3e9673167eb20812b679818 (patch)
tree23ce687ca4118e1214bcb92849bafd4c2ced8d6e
parentfedbe483260a4bc8e2cc77e7d6a543ba37170448 (diff)
Cope with XINPUT ABI 7.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/xf86PM.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/xf86PM.c b/src/xf86PM.c
index 0c01760..1e38124 100644
--- a/src/xf86PM.c
+++ b/src/xf86PM.c
@@ -181,6 +181,9 @@ ProcessDeviceInit(PenMountPrivatePtr priv, DeviceIntPtr dev, InputInfoPtr pInfo)
unsigned char map[] =
{0, 1};
int min_x, min_y, max_x, max_y;
+ Atom axis_labels[2] = { 0, 0 };
+ Atom btn_label = 0;
+
/*
* these have to be here instead of in the SetupProc, because when the
* SetupProc is run at server startup, screenInfo is not setup yet
@@ -191,7 +194,11 @@ ProcessDeviceInit(PenMountPrivatePtr priv, DeviceIntPtr dev, InputInfoPtr pInfo)
/*
* Device reports button press for 1 button.
*/
- if (InitButtonClassDeviceStruct (dev, 1, map) == FALSE)
+ if (InitButtonClassDeviceStruct (dev, 1,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ &btn_label,
+#endif
+ map) == FALSE)
{
ErrorF ("Unable to allocate PenMount ButtonClassDeviceStruct\n");
return !Success;
@@ -202,6 +209,9 @@ ProcessDeviceInit(PenMountPrivatePtr priv, DeviceIntPtr dev, InputInfoPtr pInfo)
* Axes min and max values are reported in raw coordinates.
*/
if (InitValuatorClassDeviceStruct (dev, 2,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ axis_labels,
+#endif
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
xf86GetMotionEvents,
#endif
@@ -234,11 +244,19 @@ ProcessDeviceInit(PenMountPrivatePtr priv, DeviceIntPtr dev, InputInfoPtr pInfo)
min_y = 0;
}
- InitValuatorAxisStruct (dev, 0, min_x, max_x,
+ InitValuatorAxisStruct (dev, 0,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ axis_labels[0],
+#endif
+ min_x, max_x,
9500,
0 /* min_res */ ,
9500 /* max_res */ );
- InitValuatorAxisStruct (dev, 1, min_y, max_y,
+ InitValuatorAxisStruct (dev, 1,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ axis_labels[1],
+#endif
+ min_y, max_y,
10500,
0 /* min_res */ ,
10500 /* max_res */ );