xcb\_change\_property(3) XCB Requests xcb\_change\_property(3)

# [NAME](#NAME)

xcb\_change\_property - Changes a window property

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;xcb/xproto.h&gt;**

## [Request function](#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](#REQUEST_ARGUMENTS)

[*conn*](#conn)

The XCB connection to X11.

[*mode*](#mode)

One of the following values:

[*XCB\_PROP\_MODE\_REPLACE*](#XCB_PROP_MODE_REPLACE)

Discard the previous property value and store the new data.

[*XCB\_PROP\_MODE\_PREPEND*](#XCB_PROP_MODE_PREPEND)

Insert the new data before the beginning of existing data. The *format* must match existing property value. If the property is undefined, it is treated as defined with the correct type and format with zero-length data.

[*XCB\_PROP\_MODE\_APPEND*](#XCB_PROP_MODE_APPEND)

Insert the new data after the beginning of existing data. The *format* must match existing property value. If the property is undefined, it is treated as defined with the correct type and format with zero-length data.

[*window*](#window)

The window whose property you want to change.

[*property*](#property)

The property you want to change (an atom).

[*type*](#type)

The type of the property you want to change (an atom).

[*format*](#format)

Specifies 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 information allows the X server to correctly perform byte-swap operations as necessary.

[*data\_len*](#data_len)

Specifies the number of elements (see *format*).

[*data*](#data)

The property data.

# [DESCRIPTION](#DESCRIPTION)

Sets or updates a property on the specified *window*. Properties are for example the window title (*WM\_NAME*) or its minimum size (*WM\_NORMAL\_HINTS*). Protocols such as EWMH also use properties - for example EWMH defines the window title, encoded as UTF-8 string, in the *\_NET\_WM\_NAME* property.

# [RETURN VALUE](#RETURN_VALUE)

Returns an *xcb\_void\_cookie\_t*. Errors (if any) have to be handled in the event loop.

If you want to handle errors directly with *xcb\_request\_check* instead, use *xcb\_change\_property\_checked*. See [**xcb-requests(3)**](/man/os/libxcb/xcb-requests.3) for details.

# [ERRORS](#ERRORS)

[*xcb\_alloc\_error\_t*](#xcb_alloc_error_t)

The X server could not store the property (no memory?).

[*xcb\_atom\_error\_t*](#xcb_atom_error_t)

*property* or *type* do not refer to a valid atom.

[*xcb\_match\_error\_t*](#xcb_match_error_t)

TODO: reasons?

[*xcb\_value\_error\_t*](#xcb_value_error_t)

TODO: reasons?

[*xcb\_window\_error\_t*](#xcb_window_error_t)

The specified *window* does not exist.

# [EXAMPLE](#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);
}
```

# [SEE ALSO](#SEE_ALSO)

[**xcb-requests**(3)](/man/os/libxcb/xcb-requests.3), [**xcb-examples**(3)](/man/os/libxcb/xcb-examples.3), [**xcb\_intern\_atom**(3)](/man/os/libxcb/xcb_intern_atom.3), [**xprop**(1)](/man/os/libxcb/xprop.1)

# [AUTHOR](#AUTHOR)

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.

libxcb 1.17.0 X Version 11

---

Document: xcb_change_property_checked(3) from libxcb 1.17.0-r19 (Chainguard OS)
Source: https://gitlab.freedesktop.org/xorg/lib/libxcb.git
