Bugfix: Don’t focus next window if the window was not mapped at the moment (on a different ws)

This commit is contained in:
Michael Stapelberg 2010-12-28 02:27:11 +01:00
parent dc3c633ee4
commit d184587959
1 changed files with 8 additions and 3 deletions

View File

@ -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) { void tree_close(Con *con, bool kill_window, bool dont_kill_parent) {
bool was_mapped = con->mapped;
Con *parent = con->parent; Con *parent = con->parent;
/* check floating clients and adjust old_parent if necessary */ /* 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) if (!next)
return; return;
if (was_mapped) {
DLOG("focusing %p / %s\n", next, next->name); DLOG("focusing %p / %s\n", next, next->name);
/* TODO: check if the container (or one of its children) was focused */ /* TODO: check if the container (or one of its children) was focused */
con_focus(next); con_focus(next);
} else {
DLOG("not focusing, was not mapped\n");
}
/* check if the parent container is empty now and close it */ /* check if the parent container is empty now and close it */
if (!dont_kill_parent && if (!dont_kill_parent &&