[PATCH] dix: report XI1 axis values correctly if first_valuator != 0

Peter Hutterer peter.hutterer at who-t.net
Tue Sep 22 17:25:42 PDT 2009


On Tue, Sep 22, 2009 at 08:16:21PM -0400, Thomas Jaeger wrote:
> Hi Peter,
> 
> Getting this stuff right is getting important now that evdev reports
> only valuators that changed.  Though I doubt there is any client code
> out there that interprets first_axis != 0 correctly...
> 
> Thanks,
> Tom

> From d3d536f69260c1628e12291648c9da3be09fcac7 Mon Sep 17 00:00:00 2001
> From: Thomas Jaeger <ThJaeger at gmail.com>
> Date: Tue, 22 Sep 2009 20:02:20 -0400
> Subject: [PATCH] dix: report XI1 axis values correctly if first_valuator != 0
> 
> Signed-off-by: Thomas Jaeger <ThJaeger at gmail.com>
> ---
>  dix/eventconvert.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/dix/eventconvert.c b/dix/eventconvert.c
> index d91ba67..e25f3ee 100644
> --- a/dix/eventconvert.c
> +++ b/dix/eventconvert.c
> @@ -352,17 +352,17 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
>          xv->device_state = state;
>          switch (xv->num_valuators) {
>          case 6:
> -            xv->valuator5 = ev->valuators.data[i + 5];
> +            xv->valuator5 = ev->valuators.data[xv->first_valuator + 5];
>          case 5:
> -            xv->valuator4 = ev->valuators.data[i + 4];
> +            xv->valuator4 = ev->valuators.data[xv->first_valuator + 4];
>          case 4:
> -            xv->valuator3 = ev->valuators.data[i + 3];
> +            xv->valuator3 = ev->valuators.data[xv->first_valuator + 3];
>          case 3:
> -            xv->valuator2 = ev->valuators.data[i + 2];
> +            xv->valuator2 = ev->valuators.data[xv->first_valuator + 2];
>          case 2:
> -            xv->valuator1 = ev->valuators.data[i + 1];
> +            xv->valuator1 = ev->valuators.data[xv->first_valuator + 1];
>          case 1:
> -            xv->valuator0 = ev->valuators.data[i + 0];
> +            xv->valuator0 = ev->valuators.data[xv->first_valuator + 0];
>          }
>  
>          if (i + 6 < num_valuators)
> -- 
> 1.6.3.3

thanks, merged. 

Cheers,
  Peter


More information about the xorg-devel mailing list