xcb_get_window_attributes(3)
π xcb_get_window_attributes π
okay bestie, so this one's from the XCB Requests fam, it lives in libxcb and yeah it's literally the "tell me everything about this window" request. grab a snack, we're going in π
πΈ NAME πΈ
xcb_get_window_attributes β gets window attributes, no cap π
β¨ SYNOPSIS β¨
first things first, you gotta bring in the header:
#include <xcb/xproto.h>
π Request function
xcb_get_window_attributes_cookie_t
xcb_get_window_attributes(xcb_connection_t *conn,
xcb_window_t window);
π¦ Reply datastructure
typedef struct xcb_get_window_attributes_reply_t {
uint8_t response_type;
uint8_t backing_store;
uint16_t sequence;
uint32_t length;
xcb_visualid_t visual;
uint16_t _class;
uint8_t bit_gravity;
uint8_t win_gravity;
uint32_t backing_planes;
uint32_t backing_pixel;
uint8_t save_under;
uint8_t map_is_installed;
uint8_t map_state;
uint8_t override_redirect;
xcb_colormap_t colormap;
uint32_t all_event_masks;
uint32_t your_event_mask;
uint16_t do_not_propagate_mask;
uint8_t pad0[2];
} xcb_get_window_attributes_reply_t;
π§ Reply function
xcb_get_window_attributes_reply_t
*xcb_get_window_attributes_reply(xcb_connection_t *conn,
xcb_get_window_attributes_cookie_t cookie,
xcb_generic_error_t **e);
π REQUEST ARGUMENTS π
connβ the XCB connection to X11, your lil hotline to the server πwindowβ the window you're snooping on. this is the one we're pulling attributes from.
π₯ REPLY FIELDS π₯
okay this is the juicy part, here's every single thing that comes back at you:
response_typeβ the type of this reply, and in this case it'sXCB_GET_WINDOW_ATTRIBUTES. this field also shows up inxcb_generic_reply_t, so you can use it to tell your replies apart from each other. very "which one of y'all is this" energy πsequenceβ the sequence number of the last request the X11 server processed.lengthβ how long the reply is, in words (and a word here is4bytes, periodt).backing_storeβ one of these values:XCB_BACKING_STORE_NOT_USEFULβ TODO: NOT YET DOCUMENTED.XCB_BACKING_STORE_WHEN_MAPPEDβ TODO: NOT YET DOCUMENTED.XCB_BACKING_STORE_ALWAYSβ TODO: NOT YET DOCUMENTED.
visualβ the visual structure that's associated withwindow. π_classβ one of these values:XCB_WINDOW_CLASS_COPY_FROM_PARENTβ TODO: NOT YET DOCUMENTED.XCB_WINDOW_CLASS_INPUT_OUTPUTβ TODO: NOT YET DOCUMENTED.XCB_WINDOW_CLASS_INPUT_ONLYβ TODO: NOT YET DOCUMENTED.
bit_gravityβ one of these values:XCB_GRAVITY_BIT_FORGETβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_WIN_UNMAPβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_NORTH_WESTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_NORTHβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_NORTH_EASTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_WESTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_CENTERβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_EASTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_SOUTH_WESTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_SOUTHβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_SOUTH_EASTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_STATICβ TODO: NOT YET DOCUMENTED.
win_gravityβ one of these values (yes it's the same set, they really said "copy paste slay"):XCB_GRAVITY_BIT_FORGETβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_WIN_UNMAPβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_NORTH_WESTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_NORTHβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_NORTH_EASTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_WESTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_CENTERβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_EASTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_SOUTH_WESTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_SOUTHβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_SOUTH_EASTβ TODO: NOT YET DOCUMENTED.XCB_GRAVITY_STATICβ TODO: NOT YET DOCUMENTED.
backing_planesβ planes that should be preserved if possible. like, best effort babe π«Άbacking_pixelβ the value to use when restoring planes.save_underβ boolean: should the bits underneath be saved? yes/no, iconic behaviour.map_is_installedβ TODO: NOT YET DOCUMENTED.map_stateβ one of these values:XCB_MAP_STATE_UNMAPPEDβ TODO: NOT YET DOCUMENTED.XCB_MAP_STATE_UNVIEWABLEβ TODO: NOT YET DOCUMENTED.XCB_MAP_STATE_VIEWABLEβ TODO: NOT YET DOCUMENTED.
override_redirectβ window managers should ignore this window ifoverride_redirectis1. like genuinely ignore it, it's giving main character who doesn't want to be managed πcolormapβ the color map to be associated withwindow.all_event_masksβ the set of events all people have interest in.your_event_maskβ my event mask. (yes, the manpage really said that, and honestly? relatable.)do_not_propagate_maskβ the set of events that should not propagate.
π DESCRIPTION π
Gets the current attributes for the specified window. that's it, that's the whole vibe. ask and the server shall provide β¨
β RETURN VALUE β
Returns an xcb_get_window_attributes_cookie_t. you handle errors when you call the reply function xcb_get_window_attributes_reply.
If you'd rather handle errors in the event loop instead, use xcb_get_window_attributes_unchecked. see xcb-requests(3) for the deets π§
π ERRORS π
xcb_drawable_error_tβ TODO: reasons?xcb_window_error_tβ the specified window does not exist. she's not here, bestie π
π¦ SEE ALSO π¦
π AUTHOR π
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.
okay so that's the whole page!! and per the footer: this is X Version 11, shipping with libxcb 1.17.0, and you can find it filed under xcb_get_window_attributes(3) π«Ά go forth and query those windows, you absolute icon ππ
π¦ 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