---
name: "XTranslateCoordinates"
section: "3x"
platform: "linux"
package: "libx11-dev"
version: "4.3.0.dfsg.1-14sarge7"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/XTranslateCoordinates/3x"
---

# XTranslateCoordinates(3x)

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*
