From 9f6ae61ad12cc2813d04405458e1ca5aed8a539e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 18 Dec 2007 13:57:07 +1030 Subject: [PATCH] dix: set the correct number of valuators in valuator events. (first_valuator + num_valuators) must never be larger than the number of axes, otherwise DIX freaks out. And from looking at libXI, anything larger than 6 is wrong too. --- dix/getevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/getevents.c b/dix/getevents.c index 9f955cf7b..f21bb1b88 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -392,7 +392,7 @@ getValuatorEvents(EventList *events, DeviceIntPtr pDev, int first_valuator, xv = (deviceValuator*)events->event; xv->type = DeviceValuator; xv->first_valuator = i; - xv->num_valuators = num_valuators; + xv->num_valuators = ((num_valuators - i) > 6) ? 6 : (num_valuators - i); xv->deviceid = pDev->id; switch (final_valuator - i) { case 6: