xcb_randr_get_monitors(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_randr_get_monitors(3) πŸ’–

okay so bestie, welcome to the xcb_randr_get_monitors page β€” it lives in the XCB Requests section of the manual, and it's literally your all-access pass to asking the X server "hey girl, what monitors do we have rn?" πŸ–₯️✨


✨ NAME ✨

xcb_randr_get_monitors β€” no cap, that's the whole name. The original page left the description blank, so we're just vibing with the function name itself πŸ’…


🌸 SYNOPSIS 🌸

First things first, you gotta pull in the header:

#include <xcb/randr.h>

πŸŽ€ Request function

xcb_randr_get_monitors_cookie_t
       xcb_randr_get_monitors(xcb_connection_t *conn,
       xcb_window_t window, uint8_t get_active);

πŸŽ€ Reply datastructure

typedef struct xcb_randr_get_monitors_reply_t {
    uint8_t         response_type;
    uint8_t         pad0;
    uint16_t        sequence;
    uint32_t        length;
    xcb_timestamp_t timestamp;
    uint32_t        nMonitors;
    uint32_t        nOutputs;
    uint8_t         pad1[12];
} xcb_randr_get_monitors_reply_t;

πŸŽ€ Reply function

xcb_randr_get_monitors_reply_t
       *xcb_randr_get_monitors_reply(xcb_connection_t *conn,
       xcb_randr_get_monitors_cookie_t cookie, xcb_generic_error_t **e);

πŸŽ€ Reply accessors

int xcb_randr_get_monitors_monitors_length(const
       xcb_randr_get_monitors_reply_t *reply);

xcb_randr_monitor_info_iterator_t
       xcb_randr_get_monitors_monitors_iterator(const
       xcb_randr_get_monitors_reply_t *reply);

πŸ¦‹ REQUEST ARGUMENTS πŸ¦‹

  • conn β€” your XCB connection to X11. it's giving "the phone line to the server", she's essential 🫢
  • window β€” TODO: NOT YET DOCUMENTED. yeah bestie, the docs just did not show up for this one 😭
  • get_active β€” TODO: NOT YET DOCUMENTED. same energy, absolutely no tea provided πŸ’€

πŸ’œ REPLY FIELDS πŸ’œ

  • response_type β€” the type of this reply, which in this case is XCB_RANDR_GET_MONITORS. this field also lives in the xcb_generic_reply_t, so you can use it to tell your replies apart from each other πŸ‘‘
  • sequence β€” the sequence number of the last request the X11 server processed. it's the ✨receipt number✨ of the convo
  • length β€” the length of the reply, counted in words (and a word here is 4 bytes, periodt)
  • timestamp β€” TODO: NOT YET DOCUMENTED. πŸ™ˆ
  • nMonitors β€” TODO: NOT YET DOCUMENTED. πŸ’€
  • nOutputs β€” TODO: NOT YET DOCUMENTED. 😭

🌈 DESCRIPTION 🌈

this section is empty in the original, bestie. literally nothing. a whole blank page. so we're not gonna invent lore β€” we're just gonna acknowledge the silence with respect πŸŽ€


⭐ RETURN VALUE ⭐

She returns an xcb_randr_get_monitors_cookie_t πŸͺ β€” cute, right? But heads up: errors have to be handled when you call the reply function xcb_randr_get_monitors_reply.

If you'd rather handle errors in the event loop instead, use xcb_randr_get_monitors_unchecked. See xcb-requests(3) for the details, iykyk πŸ“–βœ¨


πŸ’… ERRORS πŸ’…

This request does never generate any errors. not a single one. she's unproblematic, she's drama-free, she's the main character of requests πŸ”₯

🧚 SEE ALSO 🧚

this one's empty on the original page too β€” no references listed, so nothing to link, no crumbs left behind πŸ“


πŸ‘‘ AUTHOR πŸ‘‘

Generated from randr.xml. If you've got corrections or improvements, hit up xcb@lists.freedesktop.org β€” they're literally taking notes πŸ“πŸ’–


and that's the whole page, bestie 🫢 shoutout to X Version 11 and libxcb 1.17.0, which is exactly what this xcb_randr_get_monitors(3) page is stamped with. go check your monitors, slay, and stay hydrated πŸ’–βœ¨πŸŒΈπŸ¦‹πŸ’