]> git.sur5r.net Git - i3/i3/commitdiff
Fix assertion when moving out of a floating container.
authorFernando Tarlá Cardoso Lemos <fernandotcl@gmail.com>
Fri, 28 Jan 2011 00:06:47 +0000 (22:06 -0200)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 28 Jan 2011 00:25:06 +0000 (01:25 +0100)
src/tree.c

index 9a2aab96e769db44b60f5f5eba4858e9ef64b00e..ed953b34c37e96df89f7281f861954bbe8e5b21d 100644 (file)
@@ -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);
@@ -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