New window hook
Each frame can have a new window hook attached. Each time a new window is created, those hooks are executed on the window. This is particularly useful to assign a window to a specific frame or to create a new frame for a window. You can set a new window hook for a frame from the main menu or with some key bindings.
See clfswm-nw-hook.lisp for a new window hook list.
A very useful new window hook is 'open-in-new-frame-in-root-frame-nw-hook'. It is bound on the 'o' key for the second mode by default. This hook open the next window in a new frame in the root frame. That is to say, for a more conventional window manager, it open a new workspace for the next window.
To create your own new window hook, you have to follow this points:
- define your own nw-hook
(defun my-frame-nw-hook (frame window) "Open the next window ...doc string..." ...do what you want with frame and window... ... Frame is the frame from where the hook was called... ... Window is the new created window...)
- Define a seter function for your new hook
(defun set-my-frame-nw-hook () "Open the next window ...doc string..." (set-nw-hook #'my-frame-nw-hook))
- Register your new hook with register-nw-hook.
(register-nw-hook 'set-my-frame-nw-hook)
All this code can be placed in the configuration file.