[clfswm-devel] rearrange windows
Fernando Aguayo
beren.olvar at gmail.com
Sat Nov 6 15:06:30 UTC 2010
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
>
> > Since I couldn't find a way to do it I wrote
> > this function, which just switches the position of the current window with
> > the next one in the frame:
> >
> > -----------------------------------------------------------------
> > (defun change-pos (side)
> > (when (xlib:window-p *current-child*)
> > (let* ((parent (find-parent-frame *current-child*))
> > (managed-children (frame-child parent))
> > (len (length managed-children))
> > (pos (child-position *current-child* managed-children))
> > (npos (mod (+ pos side) len)))
> > (rotatef (nth pos (frame-child (find-parent-frame *current-child*)))
> > (nth npos (frame-child (find-parent-frame *current-child*))))
> > )))
> > -----------------------------------------------------------------
> > (sorry for my lisp ;)
> >
> No problem with your lisp (except maybe the remaining parenthesis on a
> separate line).
>
> > This almost works: every time I change the indexing I have to change
> > the layout for it to take effect. I tried to change the layout inside
> > the function but it just doesn't have the same effect.
> >
> > I also loose the focus of the moved window. How can I retain it?
> >
> Well, each time you change something in a frame, you have to manage all
> children affected by the change. For this, you use the
> 'show-all-children' function.
> By default it redisplay only the current-child and all its children.
> If your change is for children outside the current-child you must
> specify this with the optional parameter. For example if you change all
> children in the current root, you must use show-all-children with the
> *current-root* parameter.
>
> Note: be careful, this is this functions which cause the flickering in
> the current code :( (this is also one of the most complex).
>
> > Is there a better way to do it?
> >
> There is already the frame-raise/lower-child functions bounds to
> mod-1+control+page_up/down by default which change the position of the
> selected child. Here is an example of its effect:
>
> Mod-1+Control+Page_Up
> +----------+ +----------+ +----------+ +----------+
> | | 2 | | | F1| | | 3 | | | 3 |
> | +---+ | +---+ | +---+ | +---+
> | F1 | 3 | -> | 2 | 3 | -> | 2 | F1| -> | 2 | 4 |
> | +---+ | +---+ | +---+ | +---+
> | | 4 | | | 4 | | | 4 | | | F1|
> +----------+ +----------+ +----------+ +----------+
> Here the 'F' is the focused child. It doesn't change and you can grab it
> to place it where you want.
>
> I have added recently a function frame-select-next/previous-child which
> change the selected child. There is already a 'selected-pos' slot in
> each frames to tell which child is focused.
> I've bound them to mod-1+page_up/down. Here is an example of there
> effect:
>
> Mod-1+Page_Up
> +----------+ +----------+ +----------+ +----------+
> | | 2 | | | F2| | | 2 | | | 2 |
> | +---+ | +---+ | +---+ | +---+
> | F1 | 3 | -> | 1 | 3 | -> | 1 | F3| -> | 1 | 3 |
> | +---+ | +---+ | +---+ | +---+
> | | 4 | | | 4 | | | 4 | | | F4|
> +----------+ +----------+ +----------+ +----------+
>
> Here the focused child is changed each time you call those functions.
>
> Does one of those functions do what you need? If not, there is no
> problem to do it.
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?
>
>
> > Thank you!
> >
> Regards,
>
> Philippe
>
Thank you very much!
Regards
Fernando
More information about the clfswm-devel
mailing list