return false;
}
- if (workspace_is_visible(con)) {
- DLOG("A visible workspace cannot be killed.\n");
- return false;
- }
-
if (con->window != NULL) {
if (kill_window != DONT_KILL_WINDOW) {
x_window_kill(con->window->id, kill_window);
assert(focused->type != CT_OUTPUT);
assert(focused->type != CT_ROOT);
+ if (focused->type == CT_WORKSPACE) {
+ DLOG("Workspaces cannot be close, closing all children instead\n");
+ Con *child, *nextchild;
+ for (child = TAILQ_FIRST(&(focused->nodes_head)); child; ) {
+ nextchild = TAILQ_NEXT(child, nodes);
+ DLOG("killing child=%p\n", child);
+ tree_close(child, kill_window, false, false);
+ child = nextchild;
+ }
+
+ return;
+ }
+
/* Kill con */
tree_close(focused, kill_window, false, false);
}