[PATCH] dix: Clip only into axis ranges if we're in absolute mode. (#26543)

Daniel Stone daniel at fooishbar.org
Fri Feb 26 04:09:15 PST 2010


On Fri, Feb 26, 2010 at 04:56:48PM +1000, Peter Hutterer wrote:
> An absolute device in relative mode may provide valuators outside of the
> axis range. Clipping back into the range prevents screen crossings in a
> multi-screen (Xinerama) setup as the required screen edge for crossing is
> never met: miPointerSetPosition crosses the screen conditional to the X
> coordinate being equal to the screen width or _less than_ 0. While the
> former can be met when clipping into the coordinate range and scaling, the
> latter cannot, resulting in a mouse pointer that gets stuck on the rightmost
> screen.

Yep, you're right.  I'd say that mandating miSetPointerPosition in the
same way that we mandate mieq would make sense at this point; at least
that way we can have something vaguely coherent.

> This patch only applies axis clipping for valuators in mode Absolute. If
> relative, we allow the values to get above/below the axis ranges. Doesn't
> matter, miPointerSetPosition will reset the values to the allowed range even
> if no screen was crossed.
> This leads to interesting values provided to clients, the valuator range of
> the device resets once a screen is crossed and essentially reflects
> the position of the cursor on the screen - scaled into the valuator range.
> The values themselves are valid given the range though.
> In theory, the XI1 specs require that a relative device has a min/max range
> of 0/0. This doesn't really go well with devices that actually can switch
> mode between relative and absolute since they would have to reset their axis
> range when switching. If multiple XI clients are in use, we have no method
> of notifying them about the changes, so other clients may continue to use
> the wrong axis ranges (note: XI1 wasn't really designed to have multiple
> clients use a device). Expecting all relative devices to have this min/max
> of 0 is unrealistic at this point.
> So pick what is possibly the lesser of all evils, pass the beer and despair.
> X.Org Bug 26543 <http://bugs.freedesktop.org/show_bug.cgi?id=26543>

So we're fine with Xi 2 but it's only Xi 1 that's broken ... since
that's fairly easy to do now, d'you think it'd make sense to just set
the Xi 1 limits to the INT16 range always, and scale all our events up
to that when delivering Xi 1? That avoids the whole shenanigans we've
got now.

> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Reviewed-by: Daniel Stone <daniel at fooishbar.org>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100226/e18a88b8/attachment.pgp>

More information about the xorg-devel mailing list