summaryrefslogtreecommitdiff
path: root/Xext/xtest.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-03 10:29:40 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-07-06 12:59:42 +1000
commit89cf81cd85919e3dbb5adff5e6c6056c7990b60f (patch)
tree1862d8934af601fd26ad9aeffb94b7d5a98b3e21 /Xext/xtest.c
parentb773b4e8e0087993406d1d8c2df895db4d6301ff (diff)
Xext: return BadValue for XTestFakeInput on unsupported capabilities.
Calling XTestFakeDevice*Event on a device that doesn't allow the matching event returns BadValue. Reported-by: Florian Echtler Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xext/xtest.c')
-rw-r--r--Xext/xtest.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/Xext/xtest.c b/Xext/xtest.c
index 67f12ac8f..cbbc51af4 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -189,11 +189,34 @@ ProcXTestFakeInput(ClientPtr client)
switch (type) {
case XI_DeviceKeyPress:
case XI_DeviceKeyRelease:
+ if (!dev->key)
+ {
+ client->errorValue = ev->u.u.type;
+ return BadValue;
+ }
+ break;
case XI_DeviceButtonPress:
case XI_DeviceButtonRelease:
+ if (!dev->button)
+ {
+ client->errorValue = ev->u.u.type;
+ return BadValue;
+ }
+ break;
case XI_DeviceMotionNotify:
+ if (!dev->valuator)
+ {
+ client->errorValue = ev->u.u.type;
+ return BadValue;
+ }
+ break;
case XI_ProximityIn:
case XI_ProximityOut:
+ if (!dev->proximity)
+ {
+ client->errorValue = ev->u.u.type;
+ return BadValue;
+ }
break;
default:
client->errorValue = ev->u.u.type;