diff options
Diffstat (limited to 'src/XChgDCtl.c')
-rw-r--r-- | src/XChgDCtl.c | 59 |
1 files changed, 45 insertions, 14 deletions
diff --git a/src/XChgDCtl.c b/src/XChgDCtl.c index 49e3a52..e70db73 100644 --- a/src/XChgDCtl.c +++ b/src/XChgDCtl.c @@ -107,21 +107,50 @@ XChangeDeviceControl(dpy, dev, control, d) } else return (rep.status); } - case DEVICE_TOUCHSCREEN: + case DEVICE_ABS_CALIB: { - XDeviceTSControl *T = (XDeviceTSControl *) d; - xDeviceTSCtl t; - - t.control = DEVICE_TOUCHSCREEN; - t.length = sizeof(t); - t.min_x = T->min_x; - t.max_x = T->max_x; - t.min_y = T->min_y; - t.max_y = T->max_y; - t.button_threshold = T->button_threshold; - - req->length += (sizeof(t) + 3) >> 2; - Data(dpy, (char *) &t, sizeof(t)); + XDeviceAbsCalibControl *C = (XDeviceAbsCalibControl *) d; + xDeviceAbsCalibCtl c; + + c.control = DEVICE_ABS_CALIB; + c.length = sizeof(c); + c.min_x = C->min_x; + c.max_x = C->max_x; + c.min_y = C->min_y; + c.max_y = C->max_y; + c.flip_x = C->flip_x; + c.flip_y = C->flip_y; + c.rotation = C->rotation; + c.button_threshold = C->button_threshold; + + req->length += (sizeof(c) + 3) >> 2; + Data(dpy, (char *) &c, sizeof(c)); + + if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay(dpy); + SyncHandle(); + return NoSuchExtension; + } + else { + return rep.status; + } + } + case DEVICE_ABS_AREA: + { + XDeviceAbsAreaControl *A = (XDeviceAbsAreaControl *) d; + xDeviceAbsAreaCtl a; + + a.control = DEVICE_ABS_AREA; + a.length = sizeof(a); + a.offset_x = A->offset_x; + a.offset_y = A->offset_y; + a.width = A->width; + a.height = A->height; + a.screen = A->screen; + a.following = A->following; + + req->length += (sizeof(a) + 3) >> 2; + Data(dpy, (char *) &a, sizeof(a)); if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { UnlockDisplay(dpy); @@ -153,6 +182,7 @@ XChangeDeviceControl(dpy, dev, control, d) return rep.status; } } +#if 0 case DEVICE_ENABLE: { XDeviceEnableControl *E = (XDeviceEnableControl *) d; @@ -174,6 +204,7 @@ XChangeDeviceControl(dpy, dev, control, d) return rep.status; } } +#endif default: { xDeviceCtl u; |