In a running application, all window instances are arranged in a hierarchy, in which each window has a parent. The Window Server has a window not owned by the client, called the "root" window which is the parent of all the group windows.
Variant: Both (ScreenPlay and non-ScreenPlay). Target audience: Application developers.
The following diagram shows the relationship between parent and child windows and window groups at run-time. Arrows indicate "is a parent of".
The relationships between parent and child windows have the following properties:
A window's parent is specified when the window is created.
The Window Server imposes no limit to the number of children a window can have. The number of children is limited only by the resources of the system.
When a parent window is destroyed, all its children are removed from the screen. However, the objects associated with them are not destroyed until the window or the client that owns them is destroyed.
A window's parent defines the region in which the window can be displayed. A child cannot be displayed outside its parent, and is clipped to the parent’s visible region. If a child window is moved so that part of it extends beyond its parent, that part of the child window will not be visible.
Note that if a window's parent is a window group, the window can be displayed anywhere on the screen, because window groups do not have a size.
If a window has multiple children, these are known as siblings. Sibling windows are maintained in a list, and the parent window owns a link to the first window in the sibling list. The order of the windows in the sibling list represents the windows’ ordinal position. This determines which windows are displayed on top of which, if they overlap.