From 39b378b0a49bb3c177ad493468f3d369dc0b94b7 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 14 Nov 2010 23:18:39 +0100 Subject: [PATCH] =?utf8?q?don=E2=80=99t=20allow=20useless=20splits,=20chan?= =?utf8?q?ge=20orientation=20of=20existing=20split=20container=20instead?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/tree.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tree.c b/src/tree.c index 3f860923..6ba83ea7 100644 --- a/src/tree.c +++ b/src/tree.c @@ -240,11 +240,11 @@ void tree_split(Con *con, orientation_t orientation) { Con *parent = con->parent; /* if we are in a container whose parent contains only one - * child and has the same orientation like we are trying to - * set, this operation is a no-op to not confuse the user */ - if (con_orientation(parent) == orientation && - TAILQ_NEXT(con, nodes) == TAILQ_END(&(parent->nodes_head))) { - DLOG("Not splitting the same way again\n"); + * child (its split functionality is unused so far), we just change the + * orientation (more intuitive than splitting again) */ + if (con_num_children(parent) == 1) { + parent->orientation = orientation; + DLOG("Just changing orientation of existing container\n"); return; } -- 2.39.5