dix: Do not allow device transform to be set on valuatorless devices

If a device does not have any valuators, it makes no sense to set the
device transformation. Return a BadMatch error to let the caller know
that they're trying something stupid.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9ff89a2e46)
This commit is contained in:
Jason Gerecke 2015-04-29 15:08:58 +10:00 committed by Adam Jackson
parent 6f7a3366a2
commit 5b23104d58
1 changed files with 3 additions and 0 deletions

View File

@ -177,6 +177,9 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
if (!isfinite(f[i]))
return BadValue;
if (!dev->valuator)
return BadMatch;
if (!checkonly)
DeviceSetTransform(dev, f);
}