From 594cd473b7ee7d67767c5a0484e692e7bbd3944b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Fri, 25 Sep 2015 19:43:43 +0200 Subject: [PATCH] When moving a container to a mark, also check whether the container is being moved to its own descendant and reject the request if this is the case. fixes #1957 --- src/con.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/con.c b/src/con.c index 1d2795c3..b74d0ce1 100644 --- a/src/con.c +++ b/src/con.c @@ -955,8 +955,8 @@ bool con_move_to_mark(Con *con, const char *mark) { target = TAILQ_FIRST(&(target->focus_head)); } - if (con == target) { - DLOG("cannot move the container to itself, aborting.\n"); + if (con == target || con == target->parent) { + DLOG("cannot move the container to or inside itself, aborting.\n"); return false; } -- 2.39.5