XTranslateCoordinates(3) XLIB FUNCTIONS XTranslateCoordinates(3)

# [NAME](#NAME)

XTranslateCoordinates - translate window coordinates

# [SYNTAX](#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](#ARGUMENTS)

[*child\_return*](#child_return)

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

[*dest\_w*](#dest_w)

Specifies the destination window.

[*dest\_x\_return*](#dest_x_return)

[*dest\_y\_return*](#dest_y_return)

Return the x and y coordinates within the destination window.

[*display*](#display)

Specifies the connection to the X server.

[*src\_w*](#src_w)

Specifies the source window.

[*src\_x*](#src_x)

[*src\_y*](#src_y)

Specify the x and y coordinates within the source window.

# [DESCRIPTION](#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](#DIAGNOSTICS)

[**BadWindow**](#BadWindow)

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

# [SEE ALSO](#SEE_ALSO)

*Xlib - C Language X Interface*

libX11 1.8.14 X Version 11

---

Document: XTranslateCoordinates(3) from libx11 1.8.14-r2 (Chainguard OS)
Source: https://gitlab.freedesktop.org/xorg/lib/libx11.git
