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 <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Daniel Stone 2009-01-17 20:03:10 +02:00
parent 18e51911f5
commit ddb46c1421

View File

@ -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) {