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

# XTranslateCoordinates(3)

translate window coordinates

## NAME

XTranslateCoordinates - translate window coordinates

## SYNTAX

Bool XTranslateCoordinates(Display \**display*, Window *src\_w*, *dest\_w*, int *src\_x*, int *src\_y*, int \**dest\_x\_return*, int \**dest\_y\_return*, Window \**child\_return*);

## ARGUMENTS

- *child\_return*

  Returns the child if the coordinates are contained in a mapped child of the destination window.

- *dest\_w*

  Specifies the destination window.

- *dest\_x\_return*

  - *dest\_y\_return*

  Return the x and y coordinates within the destination window.

- *display*

  Specifies the connection to the X server.

- *src\_w*

  Specifies the source window.

- *src\_x*

  - *src\_y*

  Specify the x and y coordinates within the source window.

## DESCRIPTION

If **XTranslateCoordinates** returns **True**, it takes the src\_x and src\_y coordinates relative to the source window's origin and returns these coordinates to dest\_x\_return and dest\_y\_return relative to the destination window's origin. If **XTranslateCoordinates** returns **False**, src\_w and dest\_w are on different screens, and dest\_x\_return and dest\_y\_return are zero. If the coordinates are contained in a mapped child of dest\_w, that child is returned to child\_return. Otherwise, child\_return is set to **None**.

**XTranslateCoordinates** can generate a **BadWindow** error.

## DIAGNOSTICS

- **BadWindow**

  A value for a Window argument does not name a defined Window.

## SEE ALSO

*Xlib - C Language X Interface*
