Don't mess with the focus if we're not killing.

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).
next
Fernando Tarlá Cardoso Lemos 2011-01-27 21:09:48 -02:00 committed by Michael Stapelberg
parent dc6241456a
commit f465b3c11d
1 changed files with 8 additions and 3 deletions

View File

@ -177,9 +177,14 @@ void tree_close(Con *con, bool kill_window, bool dont_kill_parent) {
} }
if (was_mapped || con == focused) { if (was_mapped || con == focused) {
DLOG("focusing %p / %s\n", next, next->name); if (kill_window || !dont_kill_parent) {
/* TODO: check if the container (or one of its children) was focused */ DLOG("focusing %p / %s\n", next, next->name);
con_focus(next); /* 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 { } else {
DLOG("not focusing, was not mapped\n"); DLOG("not focusing, was not mapped\n");
} }