XIQUERYVERSION(3)
β¨ XIQUERYVERSION(3) β¨
okay bestie, welcome to the XIQUERYVERSION(3) page π this one's all about saying hi to the server and finding out what XI2 version y'all are gonna vibe with. no cap.
πΈ NAME πΈ
XIQueryVersion β announce and query the support XI2 version. that's it, that's the whole gig π«Ά
π SYNOPSIS π
#include <X11/extensions/XInput2.h>
Status XIQueryVersion( Display *display,
int *major_version_inout,
int *minor_version_inout);
displayβ the connection to the X server. your lil phone line to the server, basically πmajor_version_inoutβ you put in the client's supported XI2 version, and it comes back holding the server's supported version. it's giving double duty πminor_version_inoutβ same deal, bestie: you specify the client's supported XI2 version and it returns the server's supported version.
π DESCRIPTION π
okay so XIQueryVersion announces the client's supported XI2 version to the server and hands back the server's supported X Input version. If you're using XI2 calls, you are required to use XIQueryVersion instead of XGetExtensionVersion. like, it's not optional, it's the law π¨
The server may treat a client differently depending on the supported version the client announced. so yes, your version flex is being watched π
The major_version_inout must be 2 or greater, otherwise a BadValue error occurs. so don't try to be cute with a 1, it will not slay.
If the server does not support XI2, XIQueryVersion returns BadRequest to the client. Otherwise, XIQueryVersion returns Success. Either way β both cases, no exceptions β major_version_inout and minor_version_inout get set to the server's supported version. β¨
Now, if the client has previously called XIQueryVersion, the result depends on the previously requested version and the currently requested version. it's giving history lesson π
- If either the previous or current requested versions is less than
2.2, or if the requested major version numbers do not match, then consecutive calls toXIQueryVersionby the same client always return the first returnedmajor.minorversion. and if the client requests a version lower than the first returnedmajor.minorversion in a subsequent call, aBadValueerror occurs. sorry bestie, no downgrades π« - If all of the requested versions are
2.2or greater, then consecutive calls toXIQueryVersionby the same client with the same major version will return the requested version β but the server will operate according to the highest requested version number or the highest supported version, whichever is lower. the server lowkey takes the smaller one. periodt. π
heads up:XIQueryVersioncan generate aBadValueerror. stay safe out there π
π¦ EXAMPLES π¦
here's the whole vibe in code form, copy-paste energy:
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 π©·
BadValueβ a value is outside of the permitted range. bestie you went out of bounds π
and that's the whole page! this iconic lil number is dated 05/18/2026 and it's serving XIQUERYVERSION(3) realness from the X11 crew π go forth and query those versions, you absolute legend π«Άβ¨
π¦ where this page comes from
- fedora 44: libXi-devel 1.8.3-1.fc44 Β· MIT-open-group AND SMLNJ AND MIT
- fedora 44: libXi-devel 1.8.3-1.fc44 Β· MIT-open-group AND SMLNJ AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms