[clfswm-devel] new window hooks and others

Philippe Brochard pbrochard at common-lisp.net
Sat Oct 30 07:54:02 UTC 2010


Fernando Aguayo writes:

> Hi again,
>
Hi,

> I've been looking to the various nw-hook's but I cannot find a way to
> make certain windows (classes) to be sent to a certain frame. For
> example, I would like to make all the pidgin windows to spawn in a
> frame named "Comm". Is that possible?
>
Yes, of course. Here is what I use to have all uzbl windows go in the
uzbl frame:

------------------------------------------------------------
(defun set-uzbl-frame-nw-hook (&optional (frame *current-child*))
  "Open the window in the UZBL frame if it match uzbl absorb-nw-test"
  (when (frame-p frame)
    (setf (frame-nw-hook frame) 'absorb-window-nw-hook
	  (frame-data-slot frame :nw-absorb-test)  (nw-absorb-test-class "uzbl-core"))))

;; Add this if you want a menu entry
;; (add-menu-key 'frame-nw-hook-menu "z" 'set-uzbl-frame-nw-hook)

(defun uzbl-init-hook ()
  (let ((uzbl-frame (create-frame :name "Uzbl")))
    (add-frame uzbl-frame *root-frame*)
    (set-uzbl-frame-nw-hook uzbl-frame)))

(add-hook *init-hook* 'uzbl-init-hook)
------------------------------------------------------------

You'll have to adapt the name and classes. To know the class you can
display the window informations with the identify menu entry 
(Second mode+w+i or with the window menu)

Indeed, here the frame is created in the root frame. You can create it
in the default frame -> (first (frame-child *root-frame*))

> Other problem I'm having is regarding the info-mode. If I try
> something like
> (info-mode '("hello" "world!"))
> clfswm will crash complaining about an unhandled throw.
> Am I doing something wrong or is it a bug?
>
Well, you can't call directly a function which use the display in your
configuration file since the display is not opened when the
configuration file is loaded. This is to let us redefine all what we
want before clfswm is really started.

For this, you can add an init-hook which is executed just before the
main loop. Something like this:

------------------------------------------------------------
(defun my-show-hello-world ()
  (info-mode '("Hello" "World!")))

(add-hook *init-hook* 'my-show-hello-world)
------------------------------------------------------------ 


> Btw, the keybindings are working fine now, but lamentably I don't know
> anything about how xlib works, so I'am afraid I am of very little help
> in the flickering problem.
>
No problem with the xlib. I'd just like to know if the flickering
problem is really annoying for you or if you can live with it. 
BTW I think I know how to prevent it (reparent windows), but I'll
make this change after the next release (coming soon).

> Cheers!
> Fernando
>
Regards,

Philippe






More information about the clfswm-devel mailing list