[PATCH] Don't report old relative values in getValuatorEvents

Chase Douglas chase.douglas at canonical.com
Wed Apr 6 10:52:39 PDT 2011


On 04/05/2011 07:31 PM, Jeremy Huddleston wrote:
> (related to my recent reply for the 1.10 merge of this patch)
> 
> I believe this should this instead be:
> +            else if (dev && dev->valuator->axes[xv->first_valuator + j].mode == Absolute)

As much as I just want to be done with this issue, I think you are
right... If the internal event is converted to XI 1.x after the device
is removed, this could cause a NULL pointer dereference. I'll send
another patch to fix this up.

Thanks,

-- Chase

> On Mar 31, 2011, at 08:29, Chase Douglas wrote:
> 
>> Relative valuator values should not be reported in any future events. If
>> a relative valuator value is not set in an internal event, set the value
>> to 0 for XI 1.x valuator events sent over the wire.
>>
>> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
>> ---
>> dix/eventconvert.c |    4 +++-
>> 1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/dix/eventconvert.c b/dix/eventconvert.c
>> index 3285133..088ba98 100644
>> --- a/dix/eventconvert.c
>> +++ b/dix/eventconvert.c
>> @@ -389,8 +389,10 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
>>         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
>> +            else if (dev->valuator->axes[xv->first_valuator + j].mode == Absolute)
>>                 valuators[j] = dev->valuator->axisVal[xv->first_valuator + j];
>> +            else
>> +                valuators[j] = 0;
>>         }
>>
>>         if (i + 6 < num_valuators)
>> -- 
>> 1.7.4.1
>>
>> _______________________________________________
>> xorg-devel at lists.x.org: X.Org development
>> Archives: http://lists.x.org/archives/xorg-devel
>> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>>
> 



More information about the xorg-devel mailing list