xcb_set_selection_owner(3)
π xcb_set_selection_owner β bestie's guide to claiming a selection
okay so this is a page from the XCB Requests part of the libxcb manual (that's the X protocol C binding situation, xcb_set_selection_owner(3)), and it's literally about becoming the owner of a selection. yes the whole page. let's go π
β¨ 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β your XCB connection to X11. the whole lil pipeline to the server, periodt.ownerβ the new owner of the selection. π
the special value XCB_NONE means the selection will have no owner. like, nobody's holding it. it's free real estate.
selectionβ the selection. that's it, that's the arg. πtimeβ a timestamp, and it exists to avoid race conditions when you're running X over the network. so valid of it honestly.
here's the tea: the selection will not be changed if time is earlier than the current last-change time of the selection, or if it's later than the current X server time. otherwise, the last-change time gets set to the time you specified. π°οΈ
the special value XCB_CURRENT_TIME will be replaced with the current server time. iconic behaviour ngl.
β¨ DESCRIPTION β¨
Makes window owner the owner of the selection selection, and updates the last-change time of the specified selection. slay. π
TODO: briefly explain what a selection is. π§ (yes bestie, that's straight from the source, they left us a lil homework note and I'm not about to pretend it isn't there)
β¨ RETURN VALUE β¨
Returns an xcb_void_cookie_t. Errors (if any) have to be handled in the event loop β that's the vibe, no shortcuts. π
If you want to handle errors directly with xcb_request_check instead, use xcb_set_selection_owner_checked. See xcb-requests(3) for details. π¦
β¨ ERRORS β¨
xcb_atom_error_tβselectiondoes not refer to a valid atom. π« (caught lacking, fr fr)
β¨ SEE ALSO β¨
(yes it references itself. main character energy only. π)
β¨ AUTHOR β¨
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. π
and that's the whole page, bestie β every flag, every default, every atom error, all of it preserved π
this has been X Version 11, libxcb 1.17.0, living in the xcb_set_selection_owner(3) era. mwah, go claim your selection. π
β¨
π¦ where this page comes from
- alpine 3.22: libxcb-doc 1.17.0-r0 Β· MIT
- alpine 3.23: libxcb-doc 1.17.0-r1 Β· MIT
- alpine 3.24: libxcb-doc 1.17.0-r2 Β· MIT
- arch rolling: libxcb 1.17.0-1 Β· X11
- centos-stream 10: libxcb-devel 1.17.0-3.el10 Β· X11
- debian trixie: libxcb-doc 1.17.0-2
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- nixpkgs unstable: libxcb 1.17.0
- opensuse-leap 16.0: libxcb-devel-doc 1.17.0-160000.2.2 Β· MIT
- ubuntu questing: libxcb-doc 1.17.0-2build1
- ubuntu resolute: libxcb-doc 1.17.0-2ubuntu1
- ubuntu stonking: libxcb-doc 1.17.0-2ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms