[PATCH 2/2 v2] Handle non continuous valuator data in getValuatorEvents

Simon Thum simon.thum at gmx.de
Wed Mar 30 17:45:06 PDT 2011


On 03/29/2011 03:39 AM, Peter Hutterer wrote:
> On Mon, Mar 28, 2011 at 04:04:48PM -0400, Chase Douglas wrote:
>> This allows for masked valuators to be handled properly in XI 1.x
>> events. Any unset valuators in the device event are set to the last
>> known value when transmitted on the wire through XI 1.x valuator events.
>>
>> Fixes https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/736500
>>
>> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
> 
> Both patches merged, thanks.

>> -        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];
>> +        }

It's admittedly a bit late, but what about relative devices/axes, where
the last valuator must be assumed zero if not present?

I'm pretty sure we do that correctly for core events, but I don't really
know those paths, maybe I'm just plain wrong.

Cheers,

Simon


More information about the xorg-devel mailing list