Bugfix: Fix 'resize' command in nested containers (Thanks mseed)

Fixes: #559
This commit is contained in:
Michael Stapelberg
2011-11-29 22:36:40 +00:00
parent 9cb24375f7
commit 626e3efb48
2 changed files with 37 additions and 0 deletions

View File

@ -967,6 +967,16 @@ resize:
while (current->parent->layout == L_STACKED ||
current->parent->layout == L_TABBED)
current = current->parent;
/* Then further go up until we find one with the matching orientation. */
orientation_t search_orientation =
(direction == TOK_LEFT || direction == TOK_RIGHT ? HORIZ : VERT);
while (current->type != CT_WORKSPACE &&
current->type != CT_FLOATING_CON &&
current->parent->orientation != search_orientation)
current = current->parent;
/* get the default percentage */
int children = con_num_children(current->parent);
Con *other;