XReparentWindow(3)
β¨ XReparentWindow(3) β¨
okay so this is a page from the Xlib functions manual (yes, the X Version 11 one, we'll get to that at the end bestie π) and honestly? it's giving "window adoption agency" and I'm obsessed.
π NAME
XReparentWindow β reparent windows. that's it. that's the whole vibe. it takes a window and gives it a brand new parent π«Ά
π SYNTAX
int XReparentWindow(Display *display, Window w, Window parent, int x,
int y);
like, look at her. five arguments, one int return, main character energy fr fr π
πΈ ARGUMENTS
displayβ specifies the connection to the X server. your link to the mothership, basically πparentβ specifies the parent window. the new adoptive parent, no cap πΌwβ specifies the window. this is the baby being moved around β¨x,yβ specify the x and y coordinates of the position in the new parent window. where the window gets plopped down, coordinate-wise π
π¦ DESCRIPTION
okay so here's the tea β β if the specified window is mapped, XReparentWindow automatically performs an UnmapWindow request on it, removes it from its current position in the hierarchy, and inserts it as the child of the specified parent. she literally just picks it up and moves it. and the window is placed in the stacking order on top with respect to sibling windows β top of the pile, always, she does not do subtlety π
after reparenting the specified window, XReparentWindow causes the X server to generate a ReparentNotify event. the override_redirect member returned in this event is set to the window's corresponding attribute. window manager clients usually should ignore this window if this member is set to True β so like, if override_redirect is True, WM clients, bestie, please look away π. finally, if the specified window was originally mapped, the X server automatically performs a MapWindow request on it. it goes right back out into the world, glowing β¨
the X server performs normal exposure processing on formerly obscured windows. BUT β and this is the important bit π β the X server might not generate Expose events for regions from the initial UnmapWindow request that are immediately obscured by the final MapWindow request. so those bits can get ghosted, no redraw for them, iykyk π
aBadMatcherror results if any of these are true: - 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 π (no self-parenting, that's not the vibe) - the new parent isInputOnly, and the window is not β οΈ - the specified window has aParentRelativebackground, and the new parent window is not the same depth as the specified window π¨
XReparentWindow can generate BadMatch and BadWindow errors. periodt.
π DIAGNOSTICS
BadWindowβ a value for aWindowargument does not name a definedWindow. like, the window you're pointing at doesn't exist, and that's a whole mood π«
π SEE ALSO
XChangeSaveSet(3)Xlib - C Language X Interface
and that's the whole page, bestie π
sign-off time: this absolute icon comes to you from X Version 11, libX11 1.8.14 β go forth and reparent responsibly ππ§ββοΈβ
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms