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

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 28 22:08:58 PDT 2015


From: Jason Gerecke <killertofu at gmail.com>

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 at wacom.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Jason, I changed from BadDevice to BadMatch, BadDevice is usually reserved
for "this device doesn't exist".

 dix/devices.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dix/devices.c b/dix/devices.c
index d8e7f9c..09b62f9 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -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);
     }
-- 
2.3.5



More information about the xorg-devel mailing list