---
name: "xcb_warp_pointer"
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_warp_pointer"
---

# xcb\_warp\_pointer(3)

move mouse pointer

## NAME

xcb\_warp\_pointer - move mouse pointer

## SYNOPSIS

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

### Request function

xcb\_void\_cookie\_t **xcb\_warp\_pointer**(xcb\_connection\_t \**conn*, xcb\_window\_t *src\_window*, xcb\_window\_t *dst\_window*, int16\_t *src\_x*, int16\_t *src\_y*, uint16\_t *src\_width*, uint16\_t *src\_height*, int16\_t *dst\_x*, int16\_t *dst\_y*);\

## REQUEST ARGUMENTS

- *conn*

  The XCB connection to X11.

- *src\_window*

  If *src\_window* is not *XCB\_NONE* (TODO), the move will only take place if the pointer is inside *src\_window* and within the rectangle specified by (*src\_x*, *src\_y*, *src\_width*, *src\_height*). The rectangle coordinates are relative to *src\_window*.

- *dst\_window*

  If *dst\_window* is not *XCB\_NONE* (TODO), the pointer will be moved to the offsets (*dst\_x*, *dst\_y*) relative to *dst\_window*. If *dst\_window* is *XCB\_NONE* (TODO), the pointer will be moved by the offsets (*dst\_x*, *dst\_y*) relative to the current position of the pointer.

- *src\_x*

  TODO: NOT YET DOCUMENTED.

- *src\_y*

  TODO: NOT YET DOCUMENTED.

- *src\_width*

  TODO: NOT YET DOCUMENTED.

- *src\_height*

  TODO: NOT YET DOCUMENTED.

- *dst\_x*

  TODO: NOT YET DOCUMENTED.

- *dst\_y*

  TODO: NOT YET DOCUMENTED.

## DESCRIPTION

Moves the mouse pointer to the specified position.

If *src\_window* is not *XCB\_NONE* (TODO), the move will only take place if the pointer is inside *src\_window* and within the rectangle specified by (*src\_x*, *src\_y*, *src\_width*, *src\_height*). The rectangle coordinates are relative to *src\_window*.

If *dst\_window* is not *XCB\_NONE* (TODO), the pointer will be moved to the offsets (*dst\_x*, *dst\_y*) relative to *dst\_window*. If *dst\_window* is *XCB\_NONE* (TODO), the pointer will be moved by the offsets (*dst\_x*, *dst\_y*) relative to the current position of the pointer.

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

## ERRORS

- *xcb\_window\_error\_t*

  TODO: reasons?

## SEE ALSO

[**xcb-requests**(3)](/xcb-requests/3.md), [**xcb\_set\_input\_focus**(3)](/xcb_set_input_focus/3.md)

## AUTHOR

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