From 6a6746b967d7e82676d3805c088feb9dcb924877 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 19 Feb 2011 18:30:26 +0100 Subject: [PATCH] revert the replacement of a single h/v-split with its child container Makes more problems than it creates. Will use a different fix suggested by Merovius. --- src/con.c | 24 ------------------------ testcases/t/24-move.t | 2 +- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/con.c b/src/con.c index 92b05fd7..8992d132 100644 --- a/src/con.c +++ b/src/con.c @@ -787,28 +787,4 @@ static void con_on_remove_child(Con *con) { tree_close(con, false, false); return; } - - /* If we did not close the container, check if we have only a single child left */ - if (children == 1) { - Con *child = TAILQ_FIRST(&(con->nodes_head)); - Con *parent = con->parent; - DLOG("Container has only one child, replacing con %p with child %p\n", con, child); - - /* TODO: refactor it into con_swap */ - TAILQ_REPLACE(&(parent->nodes_head), con, child, nodes); - TAILQ_REPLACE(&(parent->focus_head), con, child, focused); - if (focused == con) - focused = child; - child->parent = parent; - child->percent = 0.0; - con_fix_percent(parent); - - con->parent = NULL; - x_con_kill(con); - free(con->name); - TAILQ_REMOVE(&all_cons, con, all_cons); - free(con); - - return; - } } diff --git a/testcases/t/24-move.t b/testcases/t/24-move.t index e887b9f3..993f48b0 100644 --- a/testcases/t/24-move.t +++ b/testcases/t/24-move.t @@ -109,7 +109,7 @@ is(@{$content}, 3, 'three nodes on this workspace'); # will be replaced by the con itself, so we will still have 3 nodes $i3->command('move right')->recv; $content = get_ws_content($tmp); -is(@{$content}, 3, 'two nodes on this workspace'); +is(@{$content}, 2, 'two nodes on this workspace'); ###################################################################### # 4) We create two v-split containers on the workspace, then we move -- 2.39.5