xcb_damage_query_version(3)

πŸ“¦
version 1.17.0 Β· 5 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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's XCB_DAMAGE_QUERY_VERSION. this field also lives in the xcb_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 πŸ’…πŸ’–βœ¨