Make resize grow|shrink width|height work for a nested split in the same direction.
Suppose a horizontally oriented workspace has two windows open. Issuing "split h" on the right window creates a nested horizontal container. If we now resize in "width" direction, the resize doesn't work because it will only operate on the current parent, which is a container with only one child, so the resize command exits. This is unexpected behavior from a user point of view. Hence, with this patch, we ensure that we don't just go up the tree until we find a parent with the correct orientation, but also keep going if that parent has only a single child. fixes #2015
This commit is contained in:
@ -615,7 +615,7 @@ static bool cmd_resize_tiling_width_height(I3_CMD, Con *current, const char *way
|
||||
|
||||
while (current->type != CT_WORKSPACE &&
|
||||
current->type != CT_FLOATING_CON &&
|
||||
con_orientation(current->parent) != search_orientation)
|
||||
(con_orientation(current->parent) != search_orientation || con_num_children(current->parent) == 1))
|
||||
current = current->parent;
|
||||
|
||||
/* get the default percentage */
|
||||
|
Reference in New Issue
Block a user