The desktop, as the main processing component, handles event propagation and display update. It has direct access to the window hierarchy cache to support its display and event propagation modules. Besides, this component also handles the desktop menu operations by making the appropriate calls.
Upon occurrence of an event, such as mouse button down, mouse drag, etc., the event propagation module of the desktop takes control. Event propagation starts with target window determination. This module uses the window hierarchy cache to traverse the current visible window hierarchy in order to determine the target window which will receive the event. Starting from the root of the current window hierarchy (TreeRoot), the hierarchy is traversed based on the location of the event and compared with the window coordinates in the hierarchy to determine the lowest level window enclosing the event location. Once the target window is determined the event is simply passed to the window handler component of the target window. The window handler component then takes appropriate action for the event, possibly propagating the event to the content handler.
As a result of window operations, such as create, delete, and resize window, a screen update might be necessary. The display module of the desktop component handles screen updates. Upon completion of a window operation the highest level window affected by the operation is passed to the display module. The display module then makes recursive calls to the draw module in the window handler component starting from the highest level window by traversing the window hierarchy cache down to lower level windows.
The menu module of the desktop component simply deals with the desktop menu operations such as load and save desktop configuration and quit Elastic Windows by making calls to the appropriate functions.