[clfswm-devel] rearrange windows

Philippe Brochard pbrochard at common-lisp.net
Sat Nov 6 22:28:13 UTC 2010


Fernando Aguayo writes:

> On Fri, Nov 05, 2010 at 10:22:53PM +0100, Philippe Brochard wrote:
>> Fernando Aguayo writes:
>> 
>> > Hi,
>> >
>> Hi,
>> 
>> > Normally, when I'm using the tiled layouts I like to rearrange the
>> > position of my windows.
>> >
>> I don't see exactly what you mean by this. Have you a window manager
>> example which act like this by default? Or maybe you can make a
>> drawing.
>
> Just imagine your tiling partition consists of two windows, one on the
> left and other on the right. I want to be able to switch them, just as
> you describe later :P
>
Ah, ok, I see. 


[...]


> I realised about the show-all-children function but it has no
> effect. Also I tried with frame-raise/lower-child, but it only works
> when on tile-left/right/...-layout. If I'm on one-column, tile, etc,
> it will do nothing, but I don't understand why :(
> What am I doing wrong?
>
I have written tile-(vertical/horizontal)-layout so that each child keep
its position.  This is done with the update-layout-managed-children in
clfswm-layout.lisp.
To do what you want, you can use the tile-left/right/...-layout with a
50% size.
Another solution is to write your own tile layout replacing
'update-layout-managed-children' with 'get-managed-child'.

Something like this: 

------------------------------------------------------------
(defmethod tile-layout (child parent)
  (let* ((managed-children (get-managed-child parent))  ;;(update-layout-managed-children child parent))
	 (pos (child-position child managed-children))
	 (len (length managed-children))
	 (n (ceiling (sqrt len)))
	 (dx (/ (frame-rw parent) n))
	 (dy (/ (frame-rh parent) (ceiling (/ len n)))))
    (values (round (+ (frame-rx parent) (truncate (* (mod pos n) dx)) 1))
	    (round (+ (frame-ry parent) (truncate (* (truncate (/ pos n)) dy)) 1))
	    (round (- dx 2))
	    (round (- dy 2)))))
------------------------------------------------------------

Do you want this code in the clfswm main repo? I can add a menu for this
layout in the main Branch.

Note: The funny thing is that the function you want is the first I've
written in clfswm-layout. And I've really thinking hard to keep children
in there position :)

> Thank you very much!
>
Hope that helps.

Regards

Philippe






More information about the clfswm-devel mailing list