---
name: "xcb_damage_create"
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_damage_create"
---

# xcb\_damage\_create(3)

Creates a Damage object to monitor changes to a drawable.

## NAME

xcb\_damage\_create - Creates a Damage object to monitor changes to a drawable.

## SYNOPSIS

**#include \<xcb/damage.h\>**

### Request function

xcb\_void\_cookie\_t **xcb\_damage\_create**(xcb\_connection\_t \**conn*, xcb\_damage\_damage\_t *damage*, xcb\_drawable\_t *drawable*, uint8\_t *level*);\

## REQUEST ARGUMENTS

- *conn*

  The XCB connection to X11.

- *damage*

  The ID with which you will refer to the new Damage object, created by *xcb\_generate\_id*.

- *drawable*

  The ID of the drawable to be monitored.

- *level*

  The level of detail to be provided in Damage events.

## DESCRIPTION

This creates a Damage object to monitor changes to a drawable, and specifies the level of detail to be reported for changes.

We call changes made to pixel contents of windows and pixmaps 'damage' throughout this extension.

Damage accumulates as drawing occurs in the drawable.  Each drawing operation are guaranteed to include the set of pixels modified by each operation, but may include significantly more than just those pixels.  The desire is for the damage to strike a balance between the number of rectangles reported and the extraneous area included.  A reasonable goal is for each primitive object drawn (line, string, rectangle) to be represented as a single rectangle and for the damage area of the operation to be the union of these rectangles.

The DAMAGE extension allows applications to either receive the raw rectangles as a stream of events, or to have them partially processed within the X server to reduce the amount of data transmitted as well as reduce the processing latency once the repaint operation has started.

The Damage object holds any accumulated damage region and reflects the relationship between the drawable selected for damage notification and the drawable for which damage is tracked.

## 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\_damage\_create\_checked*. See **[xcb-requests(3)](/xcb-requests/3.md)** for details.

## ERRORS

This request does never generate any errors.

## SEE ALSO

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

## AUTHOR

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