---
name: "xcb_get_window_attributes"
section: "3"
platform: "linux"
package: "libxcb"
version: "1.17.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/xcb_get_window_attributes"
---

# xcb\_get\_window\_attributes(3)

Gets window attributes

## NAME

xcb\_get\_window\_attributes - Gets window attributes

## SYNOPSIS

**#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.

- *window*

  The window to get the attributes from.

## REPLY FIELDS

- *response\_type*

  The type of this reply, in this case *XCB\_GET\_WINDOW\_ATTRIBUTES*. This field is also present in the *xcb\_generic\_reply\_t* and can be used to tell replies apart from each other.

- *sequence*

  The sequence number of the last request processed by the X11 server.

- *length*

  The length of the reply, in words (a word is 4 bytes).

- *backing\_store*

  One of the following 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 associated visual structure of *window*.

- *\_class*

  One of the following 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 the following 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 the following 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.

- *backing\_planes*

  Planes to be preserved if possible.

- *backing\_pixel*

  Value to be used when restoring planes.

- *save\_under*

  Boolean, should bits under be saved?

- *map\_is\_installed*

  TODO: NOT YET DOCUMENTED.

- *map\_state*

  One of the following 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 if *override\_redirect* is 1.

- *colormap*

  Color map to be associated with window.

- *all\_event\_masks*

  Set of events all people have interest in.

- *your\_event\_mask*

  My event mask.

- *do\_not\_propagate\_mask*

  Set of events that should not propagate.

## DESCRIPTION

Gets the current attributes for the specified *window*.

## RETURN VALUE

Returns an *xcb\_get\_window\_attributes\_cookie\_t*. Errors have to be handled when calling the reply function *xcb\_get\_window\_attributes\_reply*.

If you want to handle errors in the event loop instead, use *xcb\_get\_window\_attributes\_unchecked*. See **[xcb-requests(3)](/xcb-requests/3.md)** for details.

## ERRORS

- *xcb\_drawable\_error\_t*

  TODO: reasons?

- *xcb\_window\_error\_t*

  The specified *window* does not exist.

## SEE ALSO

[**xcb-requests**(3)](/xcb-requests/3.md)

## AUTHOR

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