[clfswm-devel] rearrange windows
Philippe Brochard
pbrochard at common-lisp.net
Sun Nov 7 14:00:40 UTC 2010
Fernando Aguayo writes:
[...]
>> 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.
>
Surely, this is a transitional solution.
>> 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?
>
Done in the last commit. In fact, I've added 8 lines (Lisp is
wonderful!) to let you choose to keep or not children position in all
tile layout since this can be useful sometimes.
Please, test!
While you seem to use tile layout, what do you think about impair
frame-children? Actually there is a blank for the unused
child. Something like this:
+----+----+
| F1 | 2 |
+----+----+
| 3 | B | B: blank F: focused child
+----+----+
What do you think about the blank filled by the focused child? Something
like this:
+----+----+
| F1 |
+----+----+
| 2 | 3 | B: blank (no more) F: focused child
+----+----+
>>
>> 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
>
Arf, in fact I'd like clfswm to be turned in any tiled (or not) window
manager following user request. This let us freedom to (auto)arange
windows as we like.
>> > Thank you very much!
>> >
>> Hope that helps.
>>
> Yes, it did! thank you very much!
>
Good :)
Cheers,
Philippe
More information about the clfswm-devel
mailing list