From 2a3f042241bb63601f5745f397bb1b66ecc5a592 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 20 Oct 2006 00:39:50 +0300 Subject: add DEVICE_ENABLE control, add iscore to DEVICE_CORE Add DEVICE_ENABLE for enabling/disabling devices, and an 'iscore' flag to DEVICE_CORE that specifies whether or not the device is a virtual core device. --- src/XChgDCtl.c | 21 +++++++++++++++++++++ src/XGetDCtl.c | 12 ++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/XChgDCtl.c b/src/XChgDCtl.c index 9e71475..49e3a52 100644 --- a/src/XChgDCtl.c +++ b/src/XChgDCtl.c @@ -153,6 +153,27 @@ XChangeDeviceControl(dpy, dev, control, d) return rep.status; } } + case DEVICE_ENABLE: + { + XDeviceEnableControl *E = (XDeviceEnableControl *) d; + xDeviceEnableCtl e; + + e.control = DEVICE_ENABLE; + e.length = sizeof(e); + e.enable = E->enable; + + req->length += (sizeof(e) + 3) >> 2; + Data (dpy, (char *) &e, sizeof(e)); + + if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay(dpy); + SyncHandle(); + return NoSuchExtension; + } + else { + return rep.status; + } + } default: { xDeviceCtl u; diff --git a/src/XGetDCtl.c b/src/XGetDCtl.c index 8d034bf..42f1be6 100644 --- a/src/XGetDCtl.c +++ b/src/XGetDCtl.c @@ -182,6 +182,18 @@ XGetDeviceControl(dpy, dev, control) C->control = DEVICE_CORE; C->length = sizeof(C); C->status = c->status; + C->iscore = c->iscore; + + break; + } + case DEVICE_ENABLE: + { + xDeviceEnableState *e = (xDeviceEnableState *) d; + XDeviceEnableState *E = (XDeviceEnableState *) Device; + + E->control = DEVICE_ENABLE; + E->length = sizeof(E); + E->enable = e->enable; break; } -- cgit v1.2.3