xcb_change_property(3)
π xcb_change_property β bestie edition π
okay so welcome to the xcb_change_property(3) page, part of the XCB Requests fam π«Ά this is your girl explaining how to change a window property, and honestly? it's giving main character energy.
β¨ NAME β¨
xcb_change_property β changes a window property π
πΈ SYNOPSIS πΈ
#include <xcb/xproto.h>
π Request function π
xcb_void_cookie_t xcb_change_property(xcb_connection_t *conn,
uint8_t mode, xcb_window_t window, xcb_atom_t property,
xcb_atom_t type, uint8_t format, uint32_t data_len, const
void *data);
π¦ REQUEST ARGUMENTS π¦
connβ the XCB connection to X11. your link to the mothership fr fr.modeβ pick one of these, no cap:XCB_PROP_MODE_REPLACEβ throw out whatever the property was before and store the new data instead. clean slate, new era β¨XCB_PROP_MODE_PREPENDβ slide the new data in before the beginning of the existing data. lowkey important: the format must match the existing property value. if the property is undefined, it's treated as defined with the correct type and format, but with zero-length data. yeah, it's a whole thing.XCB_PROP_MODE_APPENDβ slide the new data in after the beginning of the existing data. and again, the format must match the existing property value. if the property is undefined, it's treated as defined with the correct type and format with zero-length data. same energy, different side π
windowβ the window whose property you want to change. the one you're obsessed with.propertyβ the property you want to change (it's an atom π).typeβ the type of the property you want to change (also an atom, also iconic).formatβ tells you whether the data should be viewed as a list of 8-bit, 16-bit or 32-bit quantities. possible values are8,16and32. this is literally so the X server can correctly perform byte-swap operations when it needs to. she needs the deets to do her job πdata_lenβ how many elements there are (peepformatfor the size of each one).dataβ the property data itself. the moment. the content.
π DESCRIPTION π
Sets or updates a property on the specified window. properties are, like, the window title (WM_NAME) or its minimum size (WM_NORMAL_HINTS) β the little vibes that describe your window. protocols such as EWMH also use properties β for example EWMH defines the window title, encoded as a UTF-8 string, in the _NET_WM_NAME property. no cap, that's the whole thing.
β RETURN VALUE β
Returns an xcb_void_cookie_t. errors (if any) have to be handled in the event loop β you don't get them handed to you directly, bestie π
If you want to handle errors directly with xcb_request_check instead, use xcb_change_property_checked. see xcb-requests(3) for details.
π₯ ERRORS π₯
xcb_alloc_error_tβ the X server could not store the property (no memory? π)xcb_atom_error_tβpropertyortypedo not refer to a valid atom.xcb_match_error_tβ TODO: reasons? (yes, the original literally says this, I'm not making it up π)xcb_value_error_tβ TODO: reasons? (same π)xcb_window_error_tβ the specified window does not exist. it's not there. it ghosted you π
π EXAMPLE π
/*
* Sets the WM_NAME property of the window to "XCB Example".
*
*/
void my_example(xcb_connection_t *conn, xcb_window_t window) {
xcb_change_property(conn,
XCB_PROP_MODE_REPLACE,
window,
XCB_ATOM_WM_NAME,
XCB_ATOM_STRING,
8,
strlen("XCB Example"),
"XCB Example");
xcb_flush(conn);
}
look at her go π₯Ή sets that WM_NAME and flushes, periodt.
π SEE ALSO π
xcb-requests(3), xcb-examples(3), xcb_intern_atom(3), xprop(1)
π AUTHOR π
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. they're literally so responsive, iykyk π
and that's the page bestie!! this one's from X Version 11, libxcb 1.17.0 β mwah, go change some properties, you ate π β¨ππ¦
π¦ 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