summaryrefslogtreecommitdiff
path: root/dix/eventconvert.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/eventconvert.c')
-rw-r--r--dix/eventconvert.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 07d53e0f0..5fdd35714 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -383,19 +383,18 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
int i;
int state = 0;
int first_valuator, num_valuators;
+ DeviceIntPtr dev = NULL;
num_valuators = countValuators(ev, &first_valuator);
if (num_valuators > 0)
{
- DeviceIntPtr dev = NULL;
dixLookupDevice(&dev, ev->deviceid, serverClient, DixUseAccess);
/* State needs to be assembled BEFORE the device is updated. */
state = (dev && dev->key) ? XkbStateFieldFromRec(&dev->key->xkbInfo->state) : 0;
state |= (dev && dev->button) ? (dev->button->state) : 0;
}
- /* FIXME: non-continuous valuator data in internal events*/
for (i = 0; i < num_valuators; i += 6, xv++) {
INT32 *valuators = &xv->valuator0; // Treat all 6 vals as an array
int j;
@@ -406,8 +405,12 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
xv->deviceid = ev->deviceid;
xv->device_state = state;
- for (j = 0; j < xv->num_valuators; j++)
- valuators[j] = ev->valuators.data[xv->first_valuator + j];
+ for (j = 0; j < xv->num_valuators; j++) {
+ if (BitIsOn(ev->valuators.mask, xv->first_valuator + j))
+ valuators[j] = ev->valuators.data[xv->first_valuator + j];
+ else
+ valuators[j] = dev->valuator->axisVal[xv->first_valuator + j];
+ }
if (i + 6 < num_valuators)
xv->deviceid |= MORE_EVENTS;