diff options
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/xcalibrate.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/Xext/xcalibrate.c b/Xext/xcalibrate.c index 97ef3dc38..3fe2bdc5c 100644 --- a/Xext/xcalibrate.c +++ b/Xext/xcalibrate.c @@ -164,7 +164,6 @@ ProcXCalibrateSetRawMode (ClientPtr client) return (client->noClientException); } - static int SProcXCalibrateSetRawMode (ClientPtr client) { @@ -178,6 +177,47 @@ SProcXCalibrateSetRawMode (ClientPtr client) return ProcXCalibrateSetRawMode(client); } +static int +ProcXCalibrateScreenToCoord (ClientPtr client) +{ + REQUEST(xXCalibrateScreenToCoordReq); + xXCalibrateScreenToCoordReply rep; + + REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq); + + memset (&rep, 0, sizeof (rep)); + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.x = stuff->x; + rep.y = stuff->y; + + KdScreenToPointerCoords(&rep.x, &rep.y); + + if (client->swapped) + { + int n; + + swaps (&rep.x, n); + swaps (&rep.y, n); + } + WriteToClient(client, sizeof (rep), (char *) &rep); + return (client->noClientException); +} + +static int +SProcXCalibrateScreenToCoord (ClientPtr client) +{ + REQUEST(xXCalibrateScreenToCoordReq); + int n; + + REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq); + + swaps(&stuff->x, n); + swaps(&stuff->y, n); + + return ProcXCalibrateScreenToCoord(client); +} + static void XCalibrateResetProc (ExtensionEntry *extEntry) { @@ -192,6 +232,9 @@ ProcXCalibrateDispatch (ClientPtr client) return ProcXCalibrateQueryVersion(client); case X_XCalibrateRawMode: return ProcXCalibrateSetRawMode(client); + case X_XCalibrateScreenToCoord: + return ProcXCalibrateScreenToCoord(client); + default: break; } @@ -211,6 +254,8 @@ SProcXCalibrateDispatch (ClientPtr client) return SProcXCalibrateQueryVersion(client); case X_XCalibrateRawMode: return SProcXCalibrateSetRawMode(client); + case X_XCalibrateScreenToCoord: + return SProcXCalibrateScreenToCoord(client); default: break; } |