dix: continue to check for invalid valuator ranges.

In an ideal world, the drivers would init all axes with NO_AXIS_LIMIT. In the
real world, this is an ABI break, so let's just leave the old check in.
This commit is contained in:
Peter Hutterer 2008-05-02 10:22:06 +09:30
parent a0e6a7d4f5
commit 8e56fd9728

View File

@ -358,7 +358,14 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
{
AxisInfoPtr axis = pDev->valuator->axes + axisNum;
/* InitValuatoraAxisStruct ensures that (min < max) */
/* InitValuatoraAxisStruct ensures that (min < max). */
/* FIXME: drivers need to be updated, evdev e.g. inits axes as min = 0 and
* max = -1. Leave this extra check until the drivers have been updated.
*/
if (axis->max_value < axis->min_value)
return;
if (axis->min_value != NO_AXIS_LIMITS &&
*val < axis->min_value)