diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-18 16:11:47 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-18 16:12:22 +1000 |
commit | 2ddc4e9b2882914a56508613fe069c7335c64cc7 (patch) | |
tree | 703d212e7d9edc6170009916da13cd6da97219fe | |
parent | 91bf15dd2af4bf9a83e317b8821bcbbfdba02338 (diff) |
Protect against ABI_XINPUT_VERSION 7.
Missing the actual button and axis labeling, this can be added at a later
point in time.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/mouse.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/mouse.c b/src/mouse.c index 898d14d..fefdc1f 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1593,7 +1593,9 @@ MouseProc(DeviceIntPtr device, int what) mousePrivPtr mPriv; unsigned char map[MSE_MAXBUTTONS + 1]; int i; - + Atom btn_labels[MSE_MAXBUTTONS] = {0}; + Atom axes_labels[2] = { 0, 0 }; + pInfo = device->public.devicePrivate; pMse = pInfo->private; pMse->device = device; @@ -1609,8 +1611,13 @@ MouseProc(DeviceIntPtr device, int what) for (i = 0; i < MSE_MAXBUTTONS; i++) map[i + 1] = i + 1; + /* FIXME: we should probably set the labels here */ + InitPointerDeviceStruct((DevicePtr)device, map, min(pMse->buttons, MSE_MAXBUTTONS), +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + btn_labels, +#endif #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 miPointerGetMotionEvents, #elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 @@ -1622,13 +1629,24 @@ MouseProc(DeviceIntPtr device, int what) #else GetMotionHistorySize(), 2 #endif +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + , axes_labels +#endif ); /* X valuator */ - xf86InitValuatorAxisStruct(device, 0, -1, -1, 1, 0, 1); + xf86InitValuatorAxisStruct(device, 0, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + axes_labels[0], +#endif + -1, -1, 1, 0, 1); xf86InitValuatorDefaults(device, 0); /* Y valuator */ - xf86InitValuatorAxisStruct(device, 1, -1, -1, 1, 0, 1); + xf86InitValuatorAxisStruct(device, 1, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + axes_labels[1], +#endif + -1, -1, 1, 0, 1); xf86InitValuatorDefaults(device, 1); #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 xf86MotionHistoryAllocate(pInfo); |