xcb_screensaver_query_info(3)

πŸ“¦
version 1.17.0 Β· 4 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_screensaver_query_info πŸ’–

okay bestie, so this one lives in the xcb_screensaver chapter of the XCB Requests manual (that's the manual name right there, mwah) β€” and it's genuinely one of the cutest little request/reply pairs in the whole library. no cap. let's get into it ✨


🌸 NAME 🌸

xcb_screensaver_query_info β€” the request that asks the X server "hey girl, what's the screensaver up to right now?" and gets a whole struct of tea back πŸ«–


✨ SYNOPSIS ✨

first things first, you gotta include the header:

#include <xcb/screensaver.h>

πŸŽ€ Request function πŸŽ€

xcb_screensaver_query_info_cookie_t
       xcb_screensaver_query_info(xcb_connection_t *conn,
       xcb_drawable_t drawable);

πŸ¦‹ Reply datastructure πŸ¦‹

here's the vibe of the reply, like the actual shape of the thing:

typedef struct xcb_screensaver_query_info_reply_t {
    uint8_t      response_type;
    uint8_t      state;
    uint16_t     sequence;
    uint32_t     length;
    xcb_window_t saver_window;
    uint32_t     ms_until_server;
    uint32_t     ms_since_user_input;
    uint32_t     event_mask;
    uint8_t      kind;
    uint8_t      pad0[7];
} xcb_screensaver_query_info_reply_t;

πŸ’… Reply function πŸ’…

and here's how you actually go pick that reply up:

xcb_screensaver_query_info_reply_t
       *xcb_screensaver_query_info_reply(xcb_connection_t *conn,
       xcb_screensaver_query_info_cookie_t cookie,
       xcb_generic_error_t **e);

πŸ’œ REQUEST ARGUMENTS πŸ’œ

  • conn β€” your XCB connection to X11. the whole lifeline, the main character, the group chat you're posting in 🫢
  • drawable β€” TODO: NOT YET DOCUMENTED. yeah bestie, the docs just left it blank. iconic behaviour honestly 😭

🌈 REPLY FIELDS 🌈

  • response_type β€” the type of this reply, and in this case it's XCB_SCREENSAVER_QUERY_INFO. this field is also chillin' inside xcb_generic_reply_t, so you can use it to tell your replies apart from each other. it's giving name-tag at a party 🏷️
  • sequence β€” the sequence number of the last request the X11 server processed.
  • length β€” how long this reply is, in words. and a word here is 4 bytes, just so we're clear πŸ“
  • state β€” TODO: NOT YET DOCUMENTED.
  • saver_window β€” TODO: NOT YET DOCUMENTED.
  • ms_until_server β€” TODO: NOT YET DOCUMENTED.
  • ms_since_user_input β€” TODO: NOT YET DOCUMENTED.
  • event_mask β€” TODO: NOT YET DOCUMENTED.
  • kind β€” TODO: NOT YET DOCUMENTED.
not me listing a whole bunch of fields that the original docs literally describe as TODO: NOT YET DOCUMENTED 😭 i'm keeping them exactly as they are, bestie β€” the vibes are preserved, the facts are untouched.

🌸 DESCRIPTION 🌸

...okay so the original page has this heading and then absolutely nothing under it. an empty section. a void. the silence is loud, fr fr πŸ’€ we respect it though. periodt.


⭐ RETURN VALUE ⭐

you get back an xcb_screensaver_query_info_cookie_t. and listen β€” errors have to be handled when you call the reply function xcb_screensaver_query_info_reply, that's not optional, that's the whole deal.

if you'd rather handle your errors in the event loop instead, then use xcb_screensaver_query_info_unchecked. see xcb-requests(3) for the details, iykyk πŸ‘‘


πŸ’€ ERRORS πŸ’€

good news bestie: this request does never generate any errors. zero drama. a peaceful queen πŸ‘‘


🧚 SEE ALSO 🧚

the original page leaves this one empty too β€” nothing listed, nothing linked, just vibes ✨


πŸ“ AUTHOR πŸ“

generated from screensaver.xml. if you've got corrections or improvements, hit up xcb@lists.freedesktop.org πŸ“¬


X Version 11 🌸 libxcb 1.17.0 🌸 that's the source and version, bestie β€” and that's a wrap on xcb_screensaver_query_info(3). go forth and query, you absolute icon πŸ’–βœ¨πŸŽ€