From ddb46c1421a98190313b79621c0f5ae43b97d3f6 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sat, 17 Jan 2009 20:03:10 +0200 Subject: [PATCH] Input: Use previous state in valuator events Make valuator event state match other events by using the device state from before processing the event, not after. Also, we already check the number of valuators in UpdateDeviceState, so no need to do it again. Signed-off-by: Daniel Stone Signed-off-by: Peter Hutterer --- Xi/exevents.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 00ced5dbb..8117ec4ca 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -952,20 +952,8 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count) /* Valuator event handling */ for (i = 1; i < count; i++) { - if ((++xV)->type == DeviceValuator) { - int first = xV->first_valuator; - if (xV->num_valuators - && (!v - || (xV->num_valuators - && (first + xV->num_valuators > v->numAxes)))) - FatalError("Bad valuators reported for device %s\n", - device->name); - xV->device_state = 0; - if (k) - xV->device_state |= XkbStateFieldFromRec(&k->xkbInfo->state); - if (b) - xV->device_state |= b->state; - } + if ((++xV)->type == DeviceValuator) + xV->device_state = state; } if (xE->u.u.type == DeviceKeyPress) {