From 4fcd2f6e7ef71bef62044b09993e4dee88044e84 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 28 Nov 2010 18:05:53 +0100 Subject: [PATCH] Bugfix: Fix focus when moving Cons MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When having two v-splits on a horizontal desktop: ---------------- | t1 | t3 | |-------|------| | t2 | t4 | ---------------- …focus is on t2, and you move it into the right v-split (move after h), the focus was not properly updated. That is, inside the right v-split, focus was correct, but the workspace focus was still pointing to the left v-split. --- src/tree.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tree.c b/src/tree.c index 2d8a1333..71d46362 100644 --- a/src/tree.c +++ b/src/tree.c @@ -496,6 +496,11 @@ void tree_move(char way, orientation_t orientation) { /* TODO: don’t influence focus handling? */ } + /* We need to call con_focus() to fix the focus stack "above" the container + * we just inserted the focused container into (otherwise, the parent + * container(s) would still point to the old container(s)). */ + con_focus(focused); + if (con_num_children(old_parent) == 0) { DLOG("Old container empty after moving. Let's close it\n"); tree_close(old_parent, false, false); -- 2.39.5