If we're not killing the mapped window and we're not killing the
parent window either in tree_close, then there's no reason to try
to change the focus. This fixes focus issues when moving a
container around another container (move up, left, bottom, right).
}
if (was_mapped || con == focused) {
- DLOG("focusing %p / %s\n", next, next->name);
- /* TODO: check if the container (or one of its children) was focused */
- con_focus(next);
+ if (kill_window || !dont_kill_parent) {
+ 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 because we're not killing anybody");
+ }
} else {
DLOG("not focusing, was not mapped\n");
}