diff options
Diffstat (limited to 'Xi/chgdctl.c')
-rw-r--r-- | Xi/chgdctl.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index 32533c496..597955c34 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -107,6 +107,7 @@ ProcXChangeDeviceControl(ClientPtr client) xDeviceAbsCalibCtl *calib; xDeviceAbsAreaCtl *area; xDeviceCoreCtl *c; + xDeviceEnableCtl *e; REQUEST(xChangeDeviceControlReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq); @@ -246,6 +247,28 @@ ProcXChangeDeviceControl(ClientPtr client) } break; + case DEVICE_ENABLE: + e = (xDeviceEnableCtl *)&stuff[1]; + + status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e); + + if (status == Success) { + if (e->enable) + EnableDevice(dev); + else + DisableDevice(dev); + } else if (status == DeviceBusy) { + rep.status = DeviceBusy; + WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), + &rep); + return Success; + } else { + SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, + BadMatch); + return Success; + } + + break; default: SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, BadValue); return Success; |