xcb_free_cursor(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_free_cursor β€” the XCB Requests era, section 3

okay so bestie, welcome to xcb_free_cursor, a lil function from the XCB Requests corner of the universe (that's section 3 of the manual, iykyk). it's short, it's sweet, and it's here to help you say bye-bye to a cursor. πŸŽ€


✨ NAME ✨

xcb_free_cursor β€” deletes a cursor. that's it. that's the whole job. πŸ¦‹


🌸 SYNOPSIS 🌸

first things first, you gotta include the header, no cap:

#include <xcb/xproto.h>

🫢 Request function 🫢

here's the signature, copy it exactly, don't be cute with it:

xcb_void_cookie_t xcb_free_cursor(xcb_connection_t *conn,
       xcb_cursor_t cursor);

πŸ‘‘ REQUEST ARGUMENTS πŸ‘‘

  • conn β€” the XCB connection to X11. it's your lil hotline to the X server, your main character link-up. πŸ’–
  • cursor β€” the cursor you want to destroy. yes, destroy. we're not being gentle about it. πŸ’€

🌈 DESCRIPTION 🌈

okay so what does it actually do? it deletes the association between the cursor resource ID and that specific cursor you handed over. the way that works is lowkey elegant: the cursor doesn't get yeeted the second you ask β€” it gets freed once no other resource references it. so if other stuff is still holding onto it, it stays. iconic resource-management behaviour, honestly. ✨


⭐ RETURN VALUE ⭐

you get back an xcb_void_cookie_t. that's your lil receipt. 🧾

and here's the thing β€” errors (if there are any) have to be handled in the event loop. not right here, not right now. event loop. periodt.

if you'd rather handle errors directly with xcb_request_check instead, then use xcb_free_cursor_checked. see xcb-requests(3) for the details, bestie. πŸ’œ


πŸ’€ ERRORS πŸ’€

  • xcb_cursor_error_t β€” the specified cursor does not exist. yeah. you tried to free a cursor that isn't real. it's giving imaginary friend energy. πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯


🧚 AUTHOR 🧚

generated from xproto.xml. contact xcb@lists.freedesktop.org for corrections and improvements β€” they're the ones who actually know things, fr fr.


and that's the whole page, bestie!! this lil gem ships with libxcb 1.17.0, part of X Version 11 β€” slay, ate, no crumbs left. go forth and free those cursors responsibly. πŸ«Άβœ¨πŸŽ€