Re: [PATCH] dix: work around scaling issues during WarpPointer (#53037)

2012-08-15 Thread Keith Packard
Peter Hutterer peter.hutte...@who-t.net writes:

 Feel free to calculate what the difference in coordinate systems must be to
 favour one of the other :)

Yeah, so when possible, smashing back to known screen coords definitely
seems like the right option :-)

-- 
keith.pack...@intel.com


pgp9FyA3b5Juv.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] dix: work around scaling issues during WarpPointer (#53037)

2012-08-14 Thread Keith Packard
Peter Hutterer peter.hutte...@who-t.net writes:

 In WarpPointer calls, we get input in screen coordinates. They must be
 scaled to device coordinates, and then back to screen coordinates for screen
 crossing and root coordinates in events.

 The rounding errors introduced (and clipping in core/XI 1.x events) can lead
 to the actual position being different to the requested input coordinates.
 e.g. 200 scales to 199., truncated to 199 in the event.

Would it be useful to do a bit of rounding in these conversions
somewhere?

-- 
keith.pack...@intel.com


pgpV47L13C3L3.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] dix: work around scaling issues during WarpPointer (#53037)

2012-08-14 Thread Peter Hutterer
On Tue, Aug 14, 2012 at 05:19:45PM -0700, Keith Packard wrote:
 Peter Hutterer peter.hutte...@who-t.net writes:
 
  In WarpPointer calls, we get input in screen coordinates. They must be
  scaled to device coordinates, and then back to screen coordinates for screen
  crossing and root coordinates in events.
 
  The rounding errors introduced (and clipping in core/XI 1.x events) can lead
  to the actual position being different to the requested input coordinates.
  e.g. 200 scales to 199., truncated to 199 in the event.
 
 Would it be useful to do a bit of rounding in these conversions
 somewhere?

The only place you can round is after scaling back into the screen
coordinate system and there's still a small chance of failure. It largely
depends on the difference between screen coordinate system and device
coordinate system.

So the two options we have are:
1) round() and take the potential errors. This is the better choice for
devices where round() gives more than a pixel difference since device and
root coordinates will have less of a difference.
2) force the explicit pointer position. This will hurt more for devices that
are off by more than one pixel, but won't show up by those within a pixel.

Feel free to calculate what the difference in coordinate systems must be to
favour one of the other :)

Cheers,
   Peter


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel