xcb_damage_query_version(3)
π xcb_damage_query_version β bestie's guide to the DAMAGE handshake π
okay so real talk, this one lives in the XCB Requests section of the manual (section 3, if you're keeping score), and its whole job is so simple but so mandatory. it's xcb_damage_query_version, and it's the "hey bestie, what version are we even speaking" conversation you have with the X server before you're allowed to do literally anything else with DAMAGE.
β¨ NAME β¨
xcb_damage_query_version β negotiate the version of the DAMAGE extension π
πΈ SYNOPSIS πΈ
first, the include. it's giving "yes i brought my library card":
#include <xcb/damage.h>
π¦ Request function π¦
xcb_damage_query_version_cookie_t
xcb_damage_query_version(xcb_connection_t *conn,
uint32_t client_major_version, uint32_t client_minor_version);
π¦ Reply datastructure π¦
typedef struct xcb_damage_query_version_reply_t {
uint8_t response_type;
uint8_t pad0;
uint16_t sequence;
uint32_t length;
uint32_t major_version;
uint32_t minor_version;
uint8_t pad1[16];
} xcb_damage_query_version_reply_t;
π¦ Reply function π¦
xcb_damage_query_version_reply_t
*xcb_damage_query_version_reply(xcb_connection_t *conn,
xcb_damage_query_version_cookie_t cookie,
xcb_generic_error_t **e);
π REQUEST ARGUMENTS π
connβ the XCB connection to X11. your lil phone line to the server, essentially. πclient_major_versionβ the major version supported by the client. that's you. you're the client. speak your truth.client_minor_versionβ the minor version supported by the client. same energy, smaller number. π
π REPLY FIELDS π
response_typeβ the type of this reply, and in this case it'sXCB_DAMAGE_QUERY_VERSION. this field also lives in thexcb_generic_reply_t, so you can use it to tell replies apart from each other. it's the name tag at the party. π·οΈsequenceβ the sequence number of the last request processed by the X11 server. lowkey just a receipt number.lengthβ the length of the reply, in words. and yes, a word is 4 bytes here, that's the lore. πmajor_versionβ the major version chosen by the server. the server has opinions and it's sharing them.minor_versionβ the minor version chosen by the server. the sequel to the opinion. π
π DESCRIPTION π
so basically: this negotiates the version of the DAMAGE extension. that's it, that's the gig.
but here's the part that matters β it must precede any other request using the DAMAGE extension. like, it goes FIRST. no skipping the line, no "i'll do it later". and if you don't do it first? Failure to do so will cause a BadRequest error for those requests. π not a vibe. do the handshake. periodt.
π₯ RETURN VALUE π₯
it returns an xcb_damage_query_version_cookie_t. yep, a cookie. errors have to be handled when you call the reply function, xcb_damage_query_version_reply.
if you'd rather handle errors in the event loop instead, use xcb_damage_query_version_unchecked. see xcb-requests(3) for the details, bestie, they explain it way better than i can in one breath.
π ERRORS π
this request does never generate any errors.
not me being shocked too. zero errors. iconic behavior honestly. β¨
π«Ά SEE ALSO π«Ά
π§ AUTHOR π§
Generated from damage.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.
and that's the whole page, babe. this little cutie comes to you from X Version 11, libxcb 1.17.0, and it's filed under xcb_damage_query_version(3). go negotiate your versions and slay π
πβ¨
π¦ where this page comes from
- alpine 3.22: libxcb-doc 1.17.0-r0 Β· MIT
- alpine 3.23: libxcb-doc 1.17.0-r1 Β· MIT
- alpine 3.24: libxcb-doc 1.17.0-r2 Β· MIT
- arch rolling: libxcb 1.17.0-1 Β· X11
- centos-stream 10: libxcb-devel 1.17.0-3.el10 Β· X11
- debian trixie: libxcb-doc 1.17.0-2
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- nixpkgs unstable: libxcb 1.17.0
- opensuse-leap 16.0: libxcb-devel-doc 1.17.0-160000.2.2 Β· MIT
- ubuntu questing: libxcb-doc 1.17.0-2build1
- ubuntu resolute: libxcb-doc 1.17.0-2ubuntu1
- ubuntu stonking: libxcb-doc 1.17.0-2ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms