[PATCH] dix: fix up valuators passed to acceleration code.

Chase Douglas chase.douglas at canonical.com
Fri Nov 19 06:45:49 PST 2010


On 11/18/2010 08:09 PM, Peter Hutterer wrote:
> From: Simon Thum <simon.thum at gmx.de>
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

I don't really know how pointer acceleration algos work, but assuming
feeding them 0 coordinates on a non-changed valuator is ok:

Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

> ---
> Simon, this is essentially your patch with the extra if () addded.
> 
>  dix/getevents.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/dix/getevents.c b/dix/getevents.c
> index 9553728..7af9326 100644
> --- a/dix/getevents.c
> +++ b/dix/getevents.c
> @@ -1155,11 +1155,16 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
>               * should be converted to masked valuators. */
>              int vals[2];
>              vals[0] = valuator_mask_isset(&mask, 0) ?
> -                      valuator_mask_get(&mask, 0) : pDev->last.valuators[0];
> +                      valuator_mask_get(&mask, 0) : 0;
>              vals[1] = valuator_mask_isset(&mask, 1) ?
> -                      valuator_mask_get(&mask, 1) : pDev->last.valuators[1];
> +                      valuator_mask_get(&mask, 1) : 0;
>              accelPointer(pDev, 0, 2, vals, ms);
>  
> +            if (valuator_mask_isset(&mask, 0))
> +                valuator_mask_set(&mask, 0, vals[0]);
> +            if (valuator_mask_isset(&mask, 1))
> +                valuator_mask_set(&mask, 1, vals[1]);
> +
>              /* The pointer acceleration code modifies the fractional part
>               * in-place, so we need to extract this information first */
>              x_frac = pDev->last.remainder[0];



More information about the xorg-devel mailing list