Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Fix assertion when moving out of a floating container.
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandotcl authored and stapelberg committed Jan 28, 2011
1 parent f465b3c commit 8be4093
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/tree.c
Expand Up @@ -448,6 +448,7 @@ void tree_move(char way, orientation_t orientation) {
con_detach(focused);
con_fix_percent(focused->parent);
focused->parent = parent;
fix_percent = true;

TAILQ_INSERT_HEAD(&(parent->nodes_head), focused, nodes);
TAILQ_INSERT_HEAD(&(parent->focus_head), focused, focused);
Expand Down Expand Up @@ -526,11 +527,12 @@ void tree_move(char way, orientation_t orientation) {
/* fix the percentages in the container we moved to */
if (fix_percent) {
int children = con_num_children(focused->parent);
if (children == 1)
if (children == 1) {
focused->percent = 1.0;
else
} else {
focused->percent = 1.0 / (children - 1);
con_fix_percent(focused->parent);
con_fix_percent(focused->parent);
}
}

/* We need to call con_focus() to fix the focus stack "above" the container
Expand Down

0 comments on commit 8be4093

Please sign in to comment.