diff options
-rw-r--r-- | Xi/chgdctl.c | 5 | ||||
-rw-r--r-- | dix/devices.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index 7daf58461..31d3a57f3 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -187,7 +187,10 @@ ProcXChangeDeviceControl(ClientPtr client) case DEVICE_ENABLE: e = (xDeviceEnableCtl *) &stuff[1]; - status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e); + if (IsXTestDevice(dev, NULL)) + status = !Success; + else + status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e); if (status == Success) { if (e->enable) diff --git a/dix/devices.c b/dix/devices.c index fd4916a3a..613323fa2 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -145,9 +145,11 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, if (prop->format != 8 || prop->type != XA_INTEGER || prop->size != 1) return BadValue; - /* Don't allow disabling of VCP/VCK */ - if ((dev == inputInfo.pointer ||dev == - inputInfo.keyboard) &&!(*(CARD8 *) prop->data)) + /* Don't allow disabling of VCP/VCK or XTest devices */ + if ((dev == inputInfo.pointer || + dev == inputInfo.keyboard || + IsXTestDevice(dev, NULL)) + &&!(*(CARD8 *) prop->data)) return BadAccess; if (!checkonly) { |