- /* in the case of floating windows, we already focused another container
- * when closing the parent, so we can exit now. */
- if (!next) {
- DLOG("No next container, i will just exit now\n");
- return true;
- }
-
- if (was_mapped || con == focused) {
- if ((kill_window != DONT_KILL_WINDOW) || !dont_kill_parent || con == focused) {
- DLOG("focusing %p / %s\n", next, next->name);
- if (next->type == CT_DOCKAREA) {
- /* Instead of focusing the dockarea, we need to restore focus to the workspace */
- con_activate(con_descend_focused(output_get_content(next->parent)));
- } else {
- if (!force_set_focus && con != focused)
- DLOG("not changing focus, the container was not focused before\n");
- else
- con_activate(next);
- }
- } else {
- DLOG("not focusing because we're not killing anybody\n");
- }