x_con_kill(con);
con_detach(con);
- con_fix_percent(parent, WINDOW_REMOVE);
+ if (con->type != CT_FLOATING_CON) {
+ /* If the container is *not* floating, we might need to re-distribute
+ * percentage values for the resized containers. */
+ con_fix_percent(parent, WINDOW_REMOVE);
+ }
if (con_is_floating(con)) {
DLOG("Container was floating, killing floating container\n");
--- /dev/null
+#!perl
+# vim:ts=4:sw=4:expandtab
+#
+# Regression: when resizing two containers on a workspace, opening a floating
+# client, then closing it again, i3 will re-distribute the space on the
+# workspace as if a tiling container was closed, leading to the containers
+# taking much more space than they possibly could.
+#
+use i3test tests => 1;
+use X11::XCB qw(:all);
+use Time::HiRes qw(sleep);
+use List::Util qw(sum);
+
+my $tmp = get_unused_workspace();
+cmd "workspace $tmp";
+
+cmd 'exec /usr/bin/urxvt';
+sleep 0.5;
+cmd 'exec /usr/bin/urxvt';
+sleep 0.5;
+my ($nodes, $focus) = get_ws_content($tmp);
+my $old_sum = sum map { $_->{rect}->{width} } @{$nodes};
+#cmd 'open';
+cmd 'resize grow left 10 px or 25 ppt';
+cmd 'split v';
+#cmd 'open';
+cmd 'exec /usr/bin/urxvt';
+sleep 0.5;
+cmd 'mode toggle';
+sleep 0.5;
+cmd 'kill';
+
+sleep 0.5;
+
+($nodes, $focus) = get_ws_content($tmp);
+my $new_sum = sum map { $_->{rect}->{width} } @{$nodes};
+
+is($old_sum, $new_sum, 'combined container width is still equal');