def remove(self) -> None:
        """Removes this Window

        If this window has children, the first child takes the place of this
        window, and any remaining children are reparented to that node
        """
        if self.children:
            head = self.children[0]
            # add the first child to our parent, next to ourselves
            self.parent.add_client(head, hint=self)
            # move remaining children to be under the new head
            for i in self.children[1:]:
                head.add_client(i)

        self.parent.children.remove(self)
        del self.children
Removes this Window

        If this window has children, the first child takes the place of this
        window, and any remaining children are reparented to that node
        
libqtile/layout/tree.py