From d1845879594215450a2b8c898e6a3418ab27cdce Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 28 Dec 2010 02:27:11 +0100 Subject: [PATCH] =?UTF-8?q?Bugfix:=20Don=E2=80=99t=20focus=20next=20window?= =?UTF-8?q?=20if=20the=20window=20was=20not=20mapped=20at=20the=20moment?= =?UTF-8?q?=20(on=20a=20different=20ws)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tree.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/tree.c b/src/tree.c index 1edbf735..f86ae312 100644 --- a/src/tree.c +++ b/src/tree.c @@ -145,6 +145,7 @@ static void fix_floating_parent(Con *con, Con *vanishing) { * */ void tree_close(Con *con, bool kill_window, bool dont_kill_parent) { + bool was_mapped = con->mapped; Con *parent = con->parent; /* check floating clients and adjust old_parent if necessary */ @@ -196,9 +197,13 @@ void tree_close(Con *con, bool kill_window, bool dont_kill_parent) { if (!next) return; - DLOG("focusing %p / %s\n", next, next->name); - /* TODO: check if the container (or one of its children) was focused */ - con_focus(next); + if (was_mapped) { + DLOG("focusing %p / %s\n", next, next->name); + /* TODO: check if the container (or one of its children) was focused */ + con_focus(next); + } else { + DLOG("not focusing, was not mapped\n"); + } /* check if the parent container is empty now and close it */ if (!dont_kill_parent &&