[clfswm-devel] rearrange windows

Fernando Aguayo beren.olvar at gmail.com
Sat Nov 6 23:36:52 UTC 2010


On Sat, Nov 06, 2010 at 11:28:13PM +0100, Philippe Brochard wrote:
> 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.

It could be a solution, but I think I will keep having problems at
changing the focused window,  making it jump if I don't remember I'm
in this layout.

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

Right! I can see the probem now. Maybe adding in the contrib directory
a set of tiled layouts that do no preserve the positions, with a
slightly different name than their counterpart, so you can just choose
which one to use?

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

Probably that's the more general way to go, It's just I'm probably too
used to other manual tilers :P

> > Thank you very much!
> >
> Hope that helps.
> 
Yes, it did! thank you very much!

Regards,
Fernando




More information about the clfswm-devel mailing list