wiki:NewWindowHook
close Warning: Can't synchronize with repository "(default)" ("(default)" is not readable or not a Git repository.). Look in the Trac log for more information.

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:

  1. 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...)
    
  2. 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))
    
  3. 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.

Last modified 11 years ago Last modified on 06/14/11 20:59:20