aquariwm
aquariwm copied to clipboard
Layouts: find best compromise to try to respect as many windows' min and max sizes as possible
Vertical group example
For example, if a window in a vertical group has a minimum width larger than another window in that vertical group's maximum width, you'd either just use the minimum width of the larger one, or somewhere in between (might make the larger one unusable though).
For that same vertical group, the minimum and maximum heights of windows would also affect how window proportions are scaled and how the sizes of new windows are chosen.
If the vertical group spans the whole display's height, and it has two windows in it that both have minimum heights larger than half the display height, then both those windows would also have to be forced to be smaller than their minimum heights.
Nodes
The concept of minimum and maximum sizes will have to be supported by nodes too - a window node's minimum and maximum sizes need to be inherited by all the window node's ancestors to some degree.
This isn't going to be easy to do all the calculations around.
Manual resizing implications
This also has implications for how users are allowed to resize their nodes.
In my opinion, the way this should be handled is users simply are not allowed to resize a node more than its maximum size or less than its minimum. If the node is already in one of those situations due to having to make a compromise with other nodes, the user is able to resize the compromising nodes within the range of compromise.
Because that's not the easiest to understand, here's a diagram:
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃
┃ Window A: minimum ┃
┃ ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━━━━━━━━━━━━━━━━━━━┓
┃ ┃⎧ ⎫
┃ Window B: maximum ┃⎨ Resize range ⎬
┃ ┃⎩ ⎭
┗━━━━━━━━━━━━━━━━━━━┛