# On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # modified: src/XChgDCtl.c # diff --git a/src/XChgDCtl.c b/src/XChgDCtl.c index 952164c..a80ba08 100644 --- a/src/XChgDCtl.c +++ b/src/XChgDCtl.c @@ -216,14 +216,37 @@ XChangeDeviceControl(dpy, dev, control, d) } default: { - xDeviceCtl u; - - u.control = d->control; - u.length = d->length - sizeof(int); - length = ((unsigned)(u.length + 3) >> 2); - req->length += length; - length <<= 2; - Data(dpy, (char *)&u, length); + if(control >= DEVICE_PTRACCEL && control <= DEVICE_PTRACCEL_MAX) { + XDeviceAccelerationControl *A = (XDeviceAccelerationControl *) d; + xDeviceAccelerationCtl a; + + a.control = control; + a.length = sizeof(a); + a.integer = A->integer; + a.rational_num = A->rational_num; + a.rational_den = A->rational_den; + + req->length += (sizeof(a) + 3) >> 2; + Data (dpy, (char *) &a, sizeof(a)); + + if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay(dpy); + SyncHandle(); + return NoSuchExtension; + } else { + UnlockDisplay(dpy); + SyncHandle(); + return rep.status; + } + }else{ + xDeviceCtl u; + u.control = d->control; + u.length = d->length - sizeof(int); + length = ((unsigned)(u.length + 3) >> 2); + req->length += length; + length <<= 2; + Data(dpy, (char *)&u, length); + } } }