]> git.sur5r.net Git - i3/i3/commitdiff
when re-inserting a floating con, start with a more fair percent value
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 27 Jan 2011 14:53:14 +0000 (15:53 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 27 Jan 2011 14:53:14 +0000 (15:53 +0100)
src/floating.c

index 9e1637ab15c2b0a43dc44d413af12d488d9fd643..50987de49d3207e4a7e09978d101151de996114a 100644 (file)
@@ -151,6 +151,13 @@ void floating_disable(Con *con, bool automatic) {
 
     /* 3: re-attach to previous parent */
     con->parent = con_get_workspace(con);
+
+    /* XXX: We adjust the percentage value to start with a fair value. Floating
+     * cons always have 1.0 as percent which doesn’t work so well when
+     * re-inserting (the formerly floating con would get 50% of the target
+     * con). */
+    con->percent = (1.0 / con_num_children(con->parent));
+
     TAILQ_INSERT_TAIL(&(con->parent->nodes_head), con, nodes);
     TAILQ_INSERT_TAIL(&(con->parent->focus_head), con, focused);