The X Window System is known for its unique feature of allowing nested windows, where everything in an application, from buttons to text areas to menu entries, are treated as individual windows within the main window. This approach enables the X server to render sub-window borders and manage events like mouse clicks efficiently. Older X toolkits like Xt and Xaw heavily utilized this nested window structure, although modern toolkits have shifted to client-side drawing for more streamlined performance. Some old X window managers still employ this method for creating separate elements within a window, such as frame decorations. This complex window hierarchy provides interesting insights into the history and evolution of window systems.
https://utcc.utoronto.ca/~cks/space/blog/unix/XWindowsAllTheWayDown