summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2009-01-17 20:03:10 +0200
committerDaniel Stone <daniel@fooishbar.org>2009-01-22 15:09:00 +1100
commitddb46c1421a98190313b79621c0f5ae43b97d3f6 (patch)
tree2f90b77ac17f9feafb33e0843f460aa5c2c4c9ef
parent18e51911f5748f9a27a18cd6bb421c899f5b048f (diff)
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>
-rw-r--r--Xi/exevents.c16
1 files 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) {