Sawfish has fully integrated support for the X session management protocols. Also, this support is extensible to allow all Lisp modules to save and reload their own window state.
There are two methods of doing this. If the module only wants to save
and restore the values of properties in each window’s property list
(i.e. those values set via
window-put), then the following
functions may be used:
Arrange for all symbols properties to be saved or restored with the session.
Lists of properties (symbols) to be saved or restored with each session.
If a Lisp module chooses to use this method it may add a function to
add-window-hook to act on the reloaded properties when the
session is reloaded.
For more complex window properties that can’t be saved straight from the window’s plist two hooks are available:
A list of functions, each of which is called when the state of each window is saved. Each function is called with a single argument (the window) and should return a list of alist elements that will be saved in the state file. (As such, only values with valid read syntaxes may be included.)
List of functions called when the state of a window is restored. Each
is called with arguments
(window alist), where
alist defines the state saved for the window.
Each function should look for the properties it saved, and then take any action dependent on the values.
The following hook is also called.
Hook called after loading a saved session.
The directory that will contain all Sawfish sessions. It must be a
string. By default it is
When loading sessions, the algorithm that matches saved session data to running clients requires that if one has a session id, then so must the other, and they must match. Setting this variable to true turns that feature off, allowing some broken clients to be session managed. Defaults to false.