xcb_reparent_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_reparent_window β€” the "hey bestie, go live with a new parent now" request πŸ’–

okay so this is a page from the XCB Requests manual, section 3, and the function is xcb_reparent_window. grab a snack, we're moving windows around. πŸ¦‹


✨ SYNOPSIS ✨

#include <xcb/xproto.h>

πŸŽ€ Request function πŸŽ€

xcb_void_cookie_t xcb_reparent_window(xcb_connection_t *conn,
       xcb_window_t window, xcb_window_t parent, int16_t x, int16_t y);

🌸 REQUEST ARGUMENTS 🌸

  • conn β€” the XCB connection to X11. your link to the whole vibe, literally.
  • window β€” the window we're reparenting. the main character getting a new home. πŸ‘‘
  • parent β€” the new parent of the window. the new fam it's moving in with.
  • x β€” the X position of the window within its new parent.
  • y β€” the Y position of the window within its new parent.

πŸ’… DESCRIPTION πŸ’…

so what it does: it makes the specified window a child of the specified parent window. that's the whole thing. glow-up via new parent, no cap.

and here's the cute part β€” if the window is mapped, it will automatically be unmapped before reparenting and re-mapped after reparenting. it doesn't even need you to do anything, it just handles itself. iconic behaviour honestly. πŸ™ˆ

the window is placed in the stacking order on top with respect to sibling windows. so it shows up above its new siblings. periodt.

after reparenting, a ReparentNotify event is generated. ✨


πŸ”₯ RETURN VALUE πŸ”₯

returns an xcb_void_cookie_t. ngl bestie, errors (if any) have to be handled in the event loop β€” they do not come back to you right here.

if you want to handle errors directly with xcb_request_check instead, use xcb_reparent_window_checked. see xcb-requests(3) for details.


πŸ’€ ERRORS πŸ’€

  • xcb_match_error_t β€” this one's got a whole list of ways to get it wrong, pay attention:
    • the new parent window is not on the same screen as the old parent window.
    • the new parent window is the specified window or an inferior of the specified window.
    • the new parent is InputOnly and the window is not.
    • the specified window has a ParentRelative background and the new parent window is not the same depth as the specified window.
  • xcb_window_error_t β€” the specified window does not exist. gone. ghosted. 😭
fr fr, check the xcb_match_error_t conditions before you send this, because there are four separate ways to trip it and they're all in that one error.

🌈 SEE ALSO 🌈


🫢 AUTHOR 🫢

generated from xproto.xml. contact xcb@lists.freedesktop.org for corrections and improvements. they're nice, they want your feedback, slay.


and that's the whole page, bestie! πŸ’œ this was X Version 11, libxcb 1.17.0, and it's page xcb_reparent_window(3) β€” go forth and reparent responsibly. mwah. πŸŽ€βœ¨