diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-31 21:29:47 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-02 13:25:49 +1000 |
commit | 2174d35d5cdc475699be968a0c1b1aa82566171f (patch) | |
tree | 9bce3101f63becc0255837ce1d23abbaf15d5d54 /man | |
parent | b1dedc1293a854360d44856cd603d339ce95c777 (diff) |
Return BadRequest from XIQueryVersion if XI2 isn't supported.
XIQueryVersion (like all other calls) makes sure XGetExtensionVersion is
called beforehand anyway. So if that doesn't match 2.0 or higher, return
BadRquest before issuing the real request (which would trigger a BadRequest
error). This way, clients can use XIQueryVersion without having to set up
the error handler.
XIQueryVersion is now guaranteed to return the server-supported version.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'man')
-rw-r--r-- | man/XIQueryVersion.txt | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/man/XIQueryVersion.txt b/man/XIQueryVersion.txt index 422e51f..53118ed 100644 --- a/man/XIQueryVersion.txt +++ b/man/XIQueryVersion.txt @@ -30,13 +30,36 @@ DESCRIPTION ----------- XIQueryVersion announces the client's supported XI2 version to - the server and returns server's supported version. The server - may treat a client differently depending on the version support - announced. The major_version_inout must be 2 or greater, - otherwise a BadValue error occurs. + the server and returns server's supported X Input version. Clients + are required to use XIQueryVersion instead of XGetExtensionVersion + if they use XI2 calls. The server may treat a client differently + depending on the supported version announced by the client. + The major_version_inout must be 2 or greater, otherwise a BadValue + error occurs. + + If the server does not support XI2, XIQueryVersion returns BadRequest + to the client. Otherwise, XIQueryVersion returns Success. In both + cases major_version_inout and minor_version_inout are set to the + server's supported version. XIQueryVersion can generate a BadValue error. + +EXAMPLES +-------- + + int rc; + int major = 2; + int minor = 0; + + rc = XIQueryVersion(dpy, &major, &minor); + if (rc == Success) + printf("XI2 supported. (%d.%d)\n", major, minor); + else if (rc == BadRequest) + printf("No XI2 support. (%d.%d only)\n", major, minor); + else + printf("Internal error\n"); + DIAGNOSTICS ----------- |