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

# XSetTransientForHint(3)

set or read a window's WM\_TRANSIENT\_FOR property

## NAME

XSetTransientForHint, XGetTransientForHint - set or read a window's WM\_TRANSIENT\_FOR property

## SYNTAX

int XSetTransientForHint(Display \**display*, Window *w*, Window *prop\_window*);

Status XGetTransientForHint(Display \**display*, Window *w*, Window \**prop\_window\_return*);

## ARGUMENTS

- *display*

  Specifies the connection to the X server.

- *w*

  Specifies the window.

- *prop\_window*

  Specifies the window that the WM\_TRANSIENT\_FOR property is to be set to.

- *prop\_window\_return*

  Returns the WM\_TRANSIENT\_FOR property of the specified window.

## DESCRIPTION

The **XSetTransientForHint** function sets the WM\_TRANSIENT\_FOR property of the specified window to the specified prop\_window.

**XSetTransientForHint** can generate **BadAlloc** and **BadWindow** errors.

The **XGetTransientForHint** function returns the WM\_TRANSIENT\_FOR property for the specified window. It returns a nonzero status on success; otherwise, it returns a zero status.

**XGetTransientForHint** can generate a **BadWindow** error.

## PROPERTIES

- WM\_TRANSIENT\_FOR

  Set by application programs to indicate to the window manager that a transient top-level window, such as a dialog box.

## DIAGNOSTICS

- **BadAlloc**

  The server failed to allocate the requested resource or server memory.

- **BadWindow**

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

## SEE ALSO

[**XAllocClassHint**(3)](/XAllocClassHint/3.md), [**XAllocIconSize**(3)](/XAllocIconSize/3.md), [**XAllocSizeHints**(3)](/XAllocSizeHints/3.md), [**XAllocWMHints**(3)](/XAllocWMHints/3.md), [**XSetCommand**(3)](/XSetCommand/3.md), [**XSetTextProperty**(3)](/XSetTextProperty/3.md), [**XSetWMClientMachine**(3)](/XSetWMClientMachine/3.md), [**XSetWMColormapWindows**(3)](/XSetWMColormapWindows/3.md), [**XSetWMIconName**(3)](/XSetWMIconName/3.md), [**XSetWMName**(3)](/XSetWMName/3.md), [**XSetWMProperties**(3)](/XSetWMProperties/3.md), [**XSetWMProtocols**(3)](/XSetWMProtocols/3.md), [**XStringListToTextProperty**(3)](/XStringListToTextProperty/3.md)\
 *Xlib - C Language X Interface*
