Next: , Previous: , Up: Top   [Contents][Index]


24 Session Management

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:

Function: sm-add-saved-properties &rest properties
Function: sm-add-restored-properties &rest properties

Arrange for all symbols properties to be saved or restored with the session.

Variable: sm-saved-window-properties
Variable: sm-restored-window-properties

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 the 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:

Variable: sm-window-save-functions

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.)

Variable: sm-restore-window-hook

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.

Variable: sm-after-restore-hook

Hook called after loading a saved session.

Variable: sm-save-directory

The directory that will contain all Sawfish sessions. It must be a string. By default it is "~/.sawfish/sessions".

Variable: sm-sloppy-id-matching

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.


Next: Low-level X Interface, Previous: Standard Window Properties, Up: Top   [Contents][Index]