[Copyright status: this file is in the public domain.] Various actions take place when a client's connection to the server are closed down. This file documents them. All event selections made by the client are discarded. To put it another way, the client's event-mask on all windows is set to zero. All the client's grabs are released. Specifically: If the client has the pointer actively grabbed, the equivalent of UngrabPointer is performed. If the client has the keyboard actively grabbed, the equivalent of UngrabKeyboard is performed. All passive grabs by the client are undone. If the client has the server grabbed, the equivalent of UngrabServer is performed. All selections owned by the client (see lx_SetSelectionOwner in core.txt) are disowned. If the client's close-down mode (see lx_SetCloseDownMode) is Destroy, all of the client's resources are destroyed; if RetainPermanent or RetainTemporary, they are marked as, respectively, permanent or temporary (though other clients can still explicitly destroy them, either with the relevant request, such as FreePixmap for a pixmap, or with KillClient - see lx_KillClient in core.txt). When a client C is having its resources destroyed, some actions are performed for each window W in C's save-set. If W is an inferior of a window created by C, W is reparented to its closest ancestor which is not an inferior of a window created by C; this reparenting is such that W's upper-left outer corner does not move relative to its root window's origin. If W is unmapped, it is mapped, even if it was not reparented as just described. After save-set processing, all the client's windows are destroyed. For each nonwindow resource (eg pixmap) created by the client, the equivalent of the appropriate Free request is performed (eg, FreePixmap for a pixmap). All colormap entries allocated by the client are freed. When a connection closes in closed-down mode Destroy, and as a result of that connection close the server then has no connections, the server resets its state as if it had just been started. This destroys all remaining resources from clients which closed down with close-down mode RetainPermanent or RetainTemporary. It then deletes all but the predefined atokm identifiers. It deletes all properties on all root windows. All device maps and attributes are reset to their defaults. The access control list is reset. All root tiles and cursors are reset to their defaults. The font path is restored to its default. The input focus is set to PointerRoot. A connection close-down with close-down mode RetainPermanent or RetainTemporary will not cause a server reset, even if it leads to the server having no client connections.