xcb_get_selection_owner(3)

πŸ“¦
version 1.17.0 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… xcb_get_selection_owner β€” XCB Requests, bestie edition

okay so this is xcb_get_selection_owner(3), a lil XCB request page, and we're gonna learn her together 🫢 she lives in libxcb and she answers exactly one question: who owns this selection rn πŸ‘‘


✨ NAME ✨

xcb_get_selection_owner β€” gets the owner of a selection 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <xcb/xproto.h>

Request function πŸ’–

xcb_get_selection_owner_cookie_t
       xcb_get_selection_owner(xcb_connection_t *conn,
       xcb_atom_t selection);

Reply datastructure πŸŽ€

typedef struct xcb_get_selection_owner_reply_t {
    uint8_t      response_type;
    uint8_t      pad0;
    uint16_t     sequence;
    uint32_t     length;
    xcb_window_t owner;
} xcb_get_selection_owner_reply_t;

Reply function ✨

xcb_get_selection_owner_reply_t
       *xcb_get_selection_owner_reply(xcb_connection_t *conn,
       xcb_get_selection_owner_cookie_t cookie,
       xcb_generic_error_t **e);

🌈 REQUEST ARGUMENTS 🌈

  • conn β€” the XCB connection to X11, aka your lil hotline to the server πŸ“ž
  • selection β€” the selection. that's it, that's the argument, she's just The Selection πŸ’…

πŸ‘‘ REPLY FIELDS πŸ‘‘

  • response_type β€” the type of this reply, and in this case it's XCB_GET_SELECTION_OWNER. this field also lives in the xcb_generic_reply_t, and you can use it to tell replies apart from each other, no cap πŸ”
  • sequence β€” the sequence number of the last request processed by the X11 server πŸ”’
  • length β€” the length of the reply, in words. and yes, a word is 4 bytes, periodt πŸ“
  • owner β€” the current selection owner window πŸͺŸβœ¨

πŸ’œ DESCRIPTION πŸ’œ

Gets the owner of the specified selection. simple. iconic. does exactly what it says on the tin 🫢

TODO: briefly explain what a selection is. β€” yeah bestie, the manpage literally says this, we're not gonna pretend otherwise 😭 iykyk

πŸ”₯ RETURN VALUE πŸ”₯

Returns an xcb_get_selection_owner_cookie_t πŸͺ errors have to be handled when you call the reply function xcb_get_selection_owner_reply.

If you'd rather handle errors in the event loop instead, use xcb_get_selection_owner_unchecked. See xcb-requests(3) for details πŸ‘€


πŸ’€ ERRORS πŸ’€

  • xcb_atom_error_t β€” selection does not refer to a valid atom. not a valid atom, not a vibe, request denied πŸ™ˆ

🌟 SEE ALSO 🌟


🧚 AUTHOR 🧚

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements πŸ“¬ (yes, actual humans, go be helpful πŸ’–)


mwah, that's the whole page bestie, you ate πŸ’…βœ¨ this lil number ships as part of X Version 11, libxcb 1.17.0, and the page is xcb_get_selection_owner(3) β€” go forth and query some owners, you've got this πŸŒΈπŸ¦‹πŸŽ€