xcb_destroy_window(3)
β¨ 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 πβ¨π¦
π¦ 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