mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-29 06:50:07 +01:00
Bug # 10324: dix: Allow arbitrary value ranges in GetPointerEvents
Don't use a possitive value as a marker for if a max-value
is defined on the valuators. Use the existence of a valid
value range instead. This will also make it possible to
define arbitrary start and end-values for min and max as
long as min < max.
(cherry picked from commit f04c083869)
This commit is contained in:
parent
7fa7031cfa
commit
1d79ba8193
1 changed files with 7 additions and 4 deletions
|
|
@ -306,10 +306,13 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
|
|||
{
|
||||
AxisInfoPtr axes = pDev->valuator->axes + axisNum;
|
||||
|
||||
if (*val < axes->min_value)
|
||||
*val = axes->min_value;
|
||||
if (axes->max_value >= 0 && *val > axes->max_value)
|
||||
*val = axes->max_value;
|
||||
/* No clipping if the value-range <= 0 */
|
||||
if(axes->min_value < axes->min_value) {
|
||||
if (*val < axes->min_value)
|
||||
*val = axes->min_value;
|
||||
if (*val > axes->max_value)
|
||||
*val = axes->max_value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue