2.6. X Server Connection Close Operations
When the X server's connection to a client is closed
either by an explicit call to
or by a process that exits, the X server performs the following
It disowns all selections owned by the client
It performs an
if the client has actively grabbed the pointer
or the keyboard.
It performs an
if the client has grabbed the server.
It releases all passive grabs made by the client.
It marks all resources (including colormap entries) allocated
by the client either as permanent or temporary,
depending on whether the close-down mode is
However, this does not prevent other client applications from explicitly
destroying the resources (see
When the close-down mode is
the X server destroys all of a client's resources as follows:
It examines each window in the client's save-set to determine if it is an inferior
(subwindow) of a window created by the client.
(The save-set is a list of other clients' windows,
which are referred to as save-set windows.)
If so, the X server reparents the save-set window to the closest ancestor so
that the save-set window is not an inferior of a window created by the client.
The reparenting leaves unchanged the absolute coordinates (with respect to
the root window) of the upper-left outer corner of the save-set
It performs a
request on the save-set window if the save-set window is unmapped.
The X server does this even if the save-set window was not an inferior of
a window created by the client.
It destroys all windows created by the client.
It performs the appropriate free request on each nonwindow resource created by
the client in the server (for example,
It frees all colors and colormap entries allocated by a client application.
Additional processing occurs when the last connection to the X server closes.
An X server goes through a cycle of having no connections and having some
When the last connection to the X server closes as a result of a connection
closing with the close_mode of
the X server does the following:
It resets its state as if it had just been
The X server begins by destroying all lingering resources from
clients that have terminated in
It deletes all but the predefined atom identifiers.
It deletes all properties on all root windows (see section "Properties and Atoms").
It resets all device maps and attributes
(for example, key click, bell volume, and acceleration)
as well as the access control list.
It restores the standard root tiles and cursors.
It restores the default font path.
It restores the input focus to state
However, the X server does not reset if you close a connection with a close-down
mode set to
Christophe Tronche, email@example.com