[PATCH 2/2 v2] Handle non continuous valuator data in getValuatorEvents
Chase Douglas
chase.douglas at canonical.com
Thu Mar 31 08:31:12 PDT 2011
On 03/30/2011 08:45 PM, Simon Thum wrote:
> 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 think you are right, so I just sent a patch to fix this issue.
> 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.
Core events don't have valuators, so there's no issue there. XI 2 has
fully masked valuators, so there's no issue there either. It's only with
XI 1.x where we have valuator ranges that may span valuators without any
new values that we encounter this problem.
Thanks!
-- Chase
More information about the xorg-devel
mailing list