diff options
author | Jason Gerecke <jason.gerecke@wacom.com> | 2022-01-26 15:43:34 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2022-02-22 10:41:51 +1000 |
commit | cd02945a778132bcb63db5afec9747a15ade0033 (patch) | |
tree | 06009b173d45145aa84240a7c5bd0012ff86c2bc | |
parent | 3287bf8dd89f7d57dcbab61090f92880e01e2e77 (diff) | |
download | xf86-input-wacom-cd02945a778132bcb63db5afec9747a15ade0033.tar.gz |
Treat value of proxout property as signed
While negative / extremely large values are both invalid, migrating the
code to handle surface distances in an unsigned way is much more trouble
than its worth (due in part to some tablets reporting distance in an
opposite sense than others). It is more straightforward to leave them
signed for now and just treat the proxout property as also signed.
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r-- | src/x11/xf86WacomProperties.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/x11/xf86WacomProperties.c b/src/x11/xf86WacomProperties.c index a45ff3a..bc6e1be 100644 --- a/src/x11/xf86WacomProperties.c +++ b/src/x11/xf86WacomProperties.c @@ -788,7 +788,7 @@ static int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr pr return wcmSetActionsProperty(dev, property, prop, checkonly, ARRAY_SIZE(priv->wheel_action_props), priv->wheel_action_props, priv->wheel_actions); else if (property == prop_proxout) { - CARD32 value; + INT32 value; if (prop->size != 1 || prop->format != 32) return BadValue; @@ -796,9 +796,9 @@ static int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr pr if (!IsTablet (priv)) return BadValue; - value = *(CARD32*)prop->data; + value = *(INT32*)prop->data; - if (value > common->wcmMaxDist) + if (value > common->wcmMaxDist || value < 0) return BadValue; if (!checkonly) |