16.4 Window Save-set
The save-set is a list of windows, usually maintained by the window manager, but including only windows created by other clients. If the window manager dies, all windows listed in the save-set will be reparented back to their closest living ancestor if they were reparented in the first place and mapped if the window manager has unmapped them so that it could map an icon.
The save-set is necessary because the window manager might not exit normally. The user might kill it with CTRL-C if it is running in the foreground, or more likely, the user might get the process number and kill it. Actually, the actions of the save-set are performed even if the window manager exits normally, so less code is needed since the save-set does the cleaning up.
Window managers almost always place in the save-set all the
windows they reparent or iconify, using
XAddToSaveSet().
Windows are automatically removed from the save-set when they are
destroyed. If this were not the case, the window manager would have to
monitor DestroyNotify events and explicitly remove
the windows from the save-set.
The routines XRemoveFromSaveSet() and
XChangeSaveSet() are available, but they are not
often needed even in window managers.
XChangeSaveSet() adds or removes a window from the
save-set.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access