From: Michael Stapelberg Date: Fri, 7 Jan 2011 23:10:49 +0000 (+0100) Subject: Bugfix: Look for cons to focus *starting* at the ws, not beneath the ws (Thanks mseed) X-Git-Tag: tree-pr2~125 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=54b95497135ca051da94ec1b84ceeb4111a9a902;p=i3%2Fi3 Bugfix: Look for cons to focus *starting* at the ws, not beneath the ws (Thanks mseed) This should fix #286. --- diff --git a/src/tree.c b/src/tree.c index aa55b29a..b601cdd4 100644 --- a/src/tree.c +++ b/src/tree.c @@ -177,7 +177,12 @@ void tree_close(Con *con, bool kill_window, bool dont_kill_parent) { DLOG("parent container killed\n"); if (con == focused) { DLOG("This is the focused container, i need to find another one to focus. I start looking at ws = %p\n", ws); - next = con_next_focused(ws); + next = ws; + /* now go down the focus stack as far as + * possible, excluding the current container */ + while (!TAILQ_EMPTY(&(next->focus_head))) + next = TAILQ_FIRST(&(next->focus_head)); + dont_kill_parent = true; DLOG("Alright, focusing %p\n", next); } else {