[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg
Subject: Re: Extra pointer motion with current git xf86-input-synaptics
From: Magnus Kessler <Magnus.Kessler () gmx ! net>
Date: 2008-09-30 6:07:47
Message-ID: 200809300707.59302.Magnus.Kessler () gmx ! net
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Monday 29 September 2008, Peter Hutterer wrote:
> On Sun, Sep 28, 2008 at 07:26:06PM +0200, Simon Thum wrote:
> >> The screen coords are used to move the cursor and the scaling is done
> >> based on the axis ranges. Hence the different acceleration when you
> >> change the axis range to 0,-1 (in which case the screen coords are
> >> used as axis ranges).
> >
> > To me, this case sounds like a rounding error piling up.
> >
> > What about:
> >
> > rescaleValuatorAxis(int coord, AxisInfoPtr from, AxisInfoPtr to,
> > int defmax)
> > {
> > [...]
> > return (int)(((float)(coord - fmin) + 0.5f) * (tmax - tmin + 1) /
> > (fmax - fmin + 1)) + tmin;
>
> The patch below should fix another issue, the scaling from device -> core
> -> device. With the patch below, x/y is now used as it is reported by the
> device (unless a screen cross happens).
>
> diff --git a/dix/getevents.c b/dix/getevents.c
> index 166ab4e..f2086e8 100644
> --- a/dix/getevents.c
> +++ b/dix/getevents.c
> @@ -919,17 +919,22 @@ GetPointerEvents(EventList *events, DeviceIntPtr
> pDev, int type, int buttons, master->last.valuators[1] =
> pDev->last.valuators[1];
> }
>
> + /* Crossed screen? Scale back to device coordiantes */
> if(cx != pDev->last.valuators[0])
> + {
> + scr = miPointerGetScreen(pDev);
> + x = rescaleValuatorAxis(pDev->last.valuators[0], NULL,
> + pDev->valuator->axes + 0, scr->width);
> cx = pDev->last.valuators[0];
> + }
> if(cy != pDev->last.valuators[1])
> + {
> + scr = miPointerGetScreen(pDev);
> cy = pDev->last.valuators[1];
> + y = rescaleValuatorAxis(pDev->last.valuators[1], NULL,
> + pDev->valuator->axes + 1, scr->height);
> + }
>
> - /* scale x/y back to device coordinates */
> - scr = miPointerGetScreen(pDev);
> - x = rescaleValuatorAxis(pDev->last.valuators[0], NULL,
> - pDev->valuator->axes + 0, scr->width);
> - y = rescaleValuatorAxis(pDev->last.valuators[1], NULL,
> - pDev->valuator->axes + 1, scr->height);
>
> updateMotionHistory(pDev, ms, first_valuator, num_valuators,
> &pDev->last.valuators[first_valuator]);
> @@ -938,7 +943,6 @@ GetPointerEvents(EventList *events, DeviceIntPtr
> pDev, int type, int buttons, &pDev->last.valuators[first_valuator]);
>
> /* Update the valuators with the true value sent to the client*/
> - /* FIXME: we lose subpixel precision here. */
> if(v0) *v0 = x;
> if(v1) *v1 = y;
Thanks, Peter. Your patch solves my original problem as well. No more
unwanted pointer movement seen on my machine. Can you please commit this to
the xserver?
Regards,
Magnus
["signature.asc" (application/pgp-signature)]
_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic