xcb_change_property(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_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 are 8, 16 and 32. 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 (peep format for 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 β€” property or type do 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 πŸ’…βœ¨πŸŽ€πŸ¦‹