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>
This commit is contained in:
parent
b773b4e8e0
commit
89cf81cd85
23
Xext/xtest.c
23
Xext/xtest.c
|
@ -189,11 +189,34 @@ ProcXTestFakeInput(ClientPtr client)
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case XI_DeviceKeyPress:
|
case XI_DeviceKeyPress:
|
||||||
case XI_DeviceKeyRelease:
|
case XI_DeviceKeyRelease:
|
||||||
|
if (!dev->key)
|
||||||
|
{
|
||||||
|
client->errorValue = ev->u.u.type;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case XI_DeviceButtonPress:
|
case XI_DeviceButtonPress:
|
||||||
case XI_DeviceButtonRelease:
|
case XI_DeviceButtonRelease:
|
||||||
|
if (!dev->button)
|
||||||
|
{
|
||||||
|
client->errorValue = ev->u.u.type;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case XI_DeviceMotionNotify:
|
case XI_DeviceMotionNotify:
|
||||||
|
if (!dev->valuator)
|
||||||
|
{
|
||||||
|
client->errorValue = ev->u.u.type;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case XI_ProximityIn:
|
case XI_ProximityIn:
|
||||||
case XI_ProximityOut:
|
case XI_ProximityOut:
|
||||||
|
if (!dev->proximity)
|
||||||
|
{
|
||||||
|
client->errorValue = ev->u.u.type;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
client->errorValue = ev->u.u.type;
|
client->errorValue = ev->u.u.type;
|
||||||
|
|
Loading…
Reference in New Issue