xcb_configure_window(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_configure_window(3) ✨

okay bestie, welcome to the XCB Requests section of the manual, and today's main character is xcb_configure_window πŸ’…


πŸŽ€ NAME πŸŽ€

xcb_configure_window β€” configures window attributes ✨


🌸 SYNOPSIS 🌸

#include <xcb/xproto.h>

πŸ’– Request function πŸ’–

xcb_void_cookie_t xcb_configure_window(xcb_connection_t *conn,
       xcb_window_t window, uint16_t value_mask, const
       void *value_list);

πŸ¦‹ REQUEST ARGUMENTS πŸ¦‹

  • conn β€” the XCB connection to X11. your lil hotline to the X server, periodt πŸ“ž
  • window β€” the window you're about to configure. the one getting the glow-up πŸ’–
  • value_mask β€” a bitmask of the attributes you wanna change. it's giving "which levers am I pulling today" 🎚️
  • value_list β€” the new values, and they correspond to the attributes in value_mask. the order HAS to correspond to the order of possible value_mask bits β€” do not freestyle this, bestie 😭 see the example below, fr fr.

πŸ’œ DESCRIPTION πŸ’œ

Configures a window's size, position, border width and stacking order. that's it, that's the whole vibe ✨


🌈 RETURN VALUE 🌈

Returns an xcb_void_cookie_t. Errors (if any) have to be handled in the event loop β€” so like, you don't get them handed to you right away, you gotta go pick them up at the function's house later 🫢

If you want to handle errors directly with xcb_request_check instead, use xcb_configure_window_checked. See xcb-requests(3) for details πŸ‘‘


πŸ”₯ ERRORS πŸ”₯

  • xcb_match_error_t β€” you specified a Sibling without also specifying StackMode, or the window is not actually a Sibling. awkward πŸ’€
  • xcb_value_error_t β€” TODO: reasons? (yes the manpage literally says that, iconic honestly)
  • xcb_window_error_t β€” the specified window does not exist. TODO: any other reason? (again, straight from the source, no cap)

⭐ EXAMPLE ⭐

/*
 * Configures the given window to the left upper corner
 * with a size of 1024x768 pixels.
 *
 */
void my_example(xcb_connection_t *c, xcb_window_t window) {
    uint16_t mask = 0;

    mask |= XCB_CONFIG_WINDOW_X;
    mask |= XCB_CONFIG_WINDOW_Y;
    mask |= XCB_CONFIG_WINDOW_WIDTH;
    mask |= XCB_CONFIG_WINDOW_HEIGHT;

    const uint32_t values[] = {
        0,    /* x */
        0,    /* y */
        1024, /* width */
        768   /* height */
    };

    xcb_configure_window(c, window, mask, values);
    xcb_flush(c);
}

see how the values[] array lines up with the order of the mask bits? that's the whole assignment, bestie β€” mask order = value order, always πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

xcb-requests(3), xcb-examples(3), xcb_expose_event_t(3), xcb_map_notify_event_t(3)


🫢 AUTHOR 🫢

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. go off, xml πŸ’–


cute lil sign-off: this page came from X Version 11, libxcb 1.17.0, and it's living in the xcb_configure_window(3) slot of your manual. slay, stay configured βœ¨πŸŽ€πŸ¦‹