fluxbox 1.3.7 - Possible ArrangeWindowsStack{Bottom, Top} improvement
Alessandro DE LAURENZIS <[email protected]> Sat, 24 Aug 2019 14:54:51 +0200
| Newsgroups | gmane.comp.window-managers.fluxbox.user |
|---|---|
| Message-ID | <[email protected]> |
Dear fluxbox-users,
only recently I started to use the
ArrangeWindowsStack{Right,Left,Bottom,Top} functions (before I was
relying on a wmctrl based script to do similar arrangements).
I noticed that, while ArrangeWindowsStack{Right,Left} (see [1]) have in
principle a similar behaviour to ArrangeWindowsVertical (apart for the
main window dimensions, of course; see [2]), which is reasonable,
ArrangeWindowsStack{Bottom,Top} don't try to get the same number of rows
and columns, ending up in some situations with windows resized as small
"slices" (see [3]), which is probably suboptimal.
Applying the following trivial patch to src/WorkspaceCmd.cc:
> Index: src/WorkspaceCmd.cc
> --- src/WorkspaceCmd.cc.orig
> +++ src/WorkspaceCmd.cc
> @@ -464,7 +464,9 @@ void ArrangeWindowsCmd::execute() {
> unsigned int cols = int(sqrt((float)win_count)); // truncate to lower
> unsigned int rows = int(0.99 + float(win_count) / float(cols));
> if ( (m_tile_method == VERTICAL) || // rotate if the user has asked for it or automagically
> - ( (m_tile_method == UNSPECIFIED) && (max_width<max_height)) ) {
> + ( (m_tile_method == UNSPECIFIED) && (max_width<max_height)) ||
> + (m_tile_method == STACKTOP) ||
> + (m_tile_method == STACKBOTTOM) ) {
> std::swap(cols, rows);
> }
>
the overall arrangement makes more sense IMHO (see [4]) and it is in
line with the ArrangeWindowsHorizontal behaviour.
Is the proposed patch acceptable or do you think there are drawbacks?
All the best
[1] https://justpaste.it/3yt2q
[2] https://justpaste.it/2ffel
[3] https://justpaste.it/3qdvz
[4] https://justpaste.it/4hks6
--
Alessandro DE LAURENZIS
[mailto:[email protected]]
Web: http://www.atlantide.t28.net
LinkedIn: https://www.linkedin.com/in/delaurenzis/