A window is a rectangular area registered as a window in the window manager. The x;y position of a window is the screen coordinate of the top-left corner of the window (first pixel of the content). A subwindow is a rectangular area within a window. The x;y position of a subwindow is the top-left physical pixel of the subwindow in parent window or subwindow coordinates. A subwindow can host further subwindows. The content of a subwindow may be larger than the subwindow and may be shifted (scrolled). The top-left pixel of the content, in content-coordnates, is the subwindow's ->content_x0 and ->content_y0. These fields are always zero for a window. Both window and subwindow are represented by mbtk_window_t. A subwindow's top-parent is its final parent window in the hirerchy, which is the root of the subwindow tree and is always a real window. A subwindow is normally used for two reasons: - content scrolling (e.g. the scrolled widget, or the textedit widget) - separate drawing context (e.g. the canvas widget) Event reporting: - keyboard events are always reported for the top-parent window - mouse motion and mouse button press/release and mouse scroll is always reported for the innermost subwindow (or the top-parent if no subwindow is found at the given coords), in content coordinates. - window enter/leave/move/resize events are not delivered for subwindows, only for windows Focus widget: only the top-parent window has a focus widget.