---
name: "xcb_set_selection_owner"
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_set_selection_owner"
---

# xcb\_set\_selection\_owner(3)

Sets the owner of a selection

## NAME

xcb\_set\_selection\_owner - Sets the owner of a selection

## SYNOPSIS

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

### Request function

xcb\_void\_cookie\_t **xcb\_set\_selection\_owner**(xcb\_connection\_t \**conn*, xcb\_window\_t *owner*, xcb\_atom\_t *selection*, xcb\_timestamp\_t *time*);\

## REQUEST ARGUMENTS

- *conn*

  The XCB connection to X11.

- *owner*

  The new owner of the selection.

  The special value *XCB\_NONE* means that the selection will have no owner.

- *selection*

  The selection.

- *time*

  Timestamp to avoid race conditions when running X over the network.

  The selection will not be changed if *time* is earlier than the current last-change time of the *selection* or is later than the current X server time. Otherwise, the last-change time is set to the specified time.

  The special value *XCB\_CURRENT\_TIME* will be replaced with the current server time.

## DESCRIPTION

Makes *window* the owner of the selection *selection* and updates the last-change time of the specified selection.

TODO: briefly explain what a selection is.

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

## ERRORS

- *xcb\_atom\_error\_t*

  *selection* does not refer to a valid atom.

## SEE ALSO

[**xcb-requests**(3)](/xcb-requests/3.md), [**xcb\_set\_selection\_owner**(3)](/xcb_set_selection_owner/3.md)

## AUTHOR

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