[PATCH] randr: Make the RRConstrainCursorHarder logic the same as miPointerSetPosition

Adam Jackson ajax at redhat.com
Thu Nov 3 10:10:35 PDT 2011


On Wed, 2011-11-02 at 21:33 -0700, Keith Packard wrote:
> On Tue,  1 Nov 2011 21:32:36 +0000, Rui Matos <tiagomatos at gmail.com> wrote:
> 
> > -       if ((nx >= left) && (nx <= right) && (ny >= top) && (ny <= bottom)) {
> > -           if ((*x <= left) || (*x >= right)) {
> > -               int dx = *x - nx;
> > -
> > -               if (dx > 0)
> > -                   *x = right;
> > -               else if (dx < 0)
> > -                   *x = left;
> > -           }
> > -
> > -           if ((*y <= top) || (*y >= bottom)) {
> > -               int dy = *y - ny;
> > -
> > -               if (dy > 0)
> > -                   *y = bottom;
> > -               else if (dy < 0)
> > -                   *y = top;
> > -           }
> 
> Ajax: Can you please try to explain this logic and why it isn't
> equivalent to the obvious replacement provided in this patch?
> 
> I can't figure out why the fancy bits are any different, given the
> surrounding constraints (nx and ny inside the CRTC, x and/or y outside
> the CRTC).
> 
> Either I'm missing some subtlety, or ajax was off his meds when he wrote
> this stuff.

I would assume I was simply wrong, yeah.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111103/43a134a1/attachment.pgp>


More information about the xorg-devel mailing list