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: