Search code examples
cxlib

How to make a window remain a separate window when reassigning the parent using the Xlib function XReparentWindow()?


I'm trying to assign a parent to a window using the function XReparentWindow(), but after that my window becomes part of the parent window, it ends up being drawn into the parent window.

void setParent(Window child, Window parent) {
   Display *disp = XOpenDisplay(NULL);
   XReparentWindow(disp, child, parent, 0, 0);
   XCloseDisplay(disp);
}

Tell me please how to make a window remain a separate window when reassigning the parent using the Xlib functions?


Solution

  • XSetTransientForHint(display, child, parent)