メインコンテンツまでスキップ

Connection Close

What happens at connection close​

All event selections made by the client are discarded. If the client has the pointer actively grabbed, an UngrabPointer is performed. If the client has the keyboard actively grabbed, an UngrabKeyboard is performed. All passive grabs by the client are eleased. If the client has the server grabbed, and UngrabServer is performed. If close-down mode (see ChangeCloseDownMode) is RetainPermanent or RetainTemporary, then all resources (including colormap entries) allocated by the client are marked as "permanent" or "temporary", respectively (but this does not prevent other clients from explicitly destroying them). If the mode is Destroy, then all of the client's resources are destroyed as described below.

What happens when a client's resources are destroyed​

For each window in the client's save-set, if the window created by the client, that save-set window is reparented to the closest ancestor such that the save-set window is not an inferior of a window created by the client. If the save-set window is unmaped, a MapWindow request is performed on it. After save-set processing, all windows created by the client are destroyed. For each non-window resource created by the client, the appropriate Free request is performed. All colors and colormap entries allocated by the client are freed.

What happens when the last connection to a server closes​

A server goes through a cycle, of having no connections and having some connections. At every transition to the state of having no connections, the server "resets" its state, as if it had just been started. This starts by destroying all lingering resources from clients that have terminated in RetainPermanent or RetainTemporary mode. It additionally includes deleting all but the predefined atom identifiers, deleting all properties on all root windows, resetting all device maps and attributes (key click, bell volume, acceleration), resetting the access control list, restoring the standard root tiles and cursors, restoring the default font path, and restoring the input focus to state PointerRoot.