xcb_destroy_window(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_destroy_window ✨

okay bestie, gather round, because today we're learning how to actually delete a window in XCB and it's giving main character energy πŸ’…

This is xcb_destroy_window from libxcb, and it does exactly one thing: it destroys a window. That's it. That's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

First things first, you gotta pull in the header or literally nothing works:

#include <xcb/xproto.h>

πŸ¦‹ Request function πŸ¦‹

Here's the function signature, and yes she's a void cookie situation, we'll get to that:

xcb_void_cookie_t xcb_destroy_window(xcb_connection_t *conn,
       xcb_window_t window);

πŸ’– REQUEST ARGUMENTS πŸ’–

  • conn β€” the XCB connection to X11. your little hotline to the server, no cap πŸ”₯
  • window β€” the window to destroy. the one getting the ✨ unalive treatment ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the tea, and it's important tea:

Calling this destroys the window you passed in and all of its subwindows. Every single one. Not a drill. 😭

A DestroyNotify event gets generated for each destroyed window. And here's the detail that matters: a DestroyNotify event is first generated for any given window's inferiors. So the children get their goodbye notes before the parent does. order matters, bestie 🌈

And if the window was mapped? It gets automatically unmapped before destroying. she's polite like that πŸ’…

⚠️ WAIT. Calling DestroyWindow on the root window will do nothing. literally nothing. it's a no-op. the root window is built different and cannot be taken out. periodt. πŸ’€

🫢 RETURN VALUE 🫢

Returns an xcb_void_cookie_t. Errors (if there are any) have to be handled in the event loop, so you can't just ignore the vibes and move on.

If you want to handle errors directly with xcb_request_check instead, use xcb_destroy_window_checked. See xcb-requests(3) for the deets. 🧚


πŸ“ ERRORS πŸ“

  • xcb_window_error_t β€” the specified window does not exist. bestie it's not there. it never was. or it's already gone πŸ’œ

⭐ SEE ALSO ⭐

go read these next, they're all part of the same little friend group:


🌟 AUTHOR 🌟

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. (yes, actual humans read that inbox, be nice πŸ₯Ί)


and that's the whole page, bestie! this lil icon came from X Version 11, libxcb 1.17.0, dated xcb_destroy_window(3) β€” so go forth, destroy some windows (the X11 kind, pls, not your actual ones πŸ™ˆ), and slay πŸ’–βœ¨πŸ¦‹