|
|
@ -27,10 +27,7 @@ static void free_swayc(swayc_t *c) {
|
|
|
|
list_free(c->children);
|
|
|
|
list_free(c->children);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (c->parent) {
|
|
|
|
if (c->parent) {
|
|
|
|
if (c->parent->focused == c) {
|
|
|
|
remove_child(c);
|
|
|
|
c->parent->focused = NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
remove_child(c->parent, c);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (c->name) {
|
|
|
|
if (c->name) {
|
|
|
|
free(c->name);
|
|
|
|
free(c->name);
|
|
|
@ -118,6 +115,11 @@ swayc_t *new_container(swayc_t *child, enum swayc_layouts layout) {
|
|
|
|
//reorder focus
|
|
|
|
//reorder focus
|
|
|
|
cont->focused = workspace->focused;
|
|
|
|
cont->focused = workspace->focused;
|
|
|
|
workspace->focused = cont;
|
|
|
|
workspace->focused = cont;
|
|
|
|
|
|
|
|
//set all children focu to container
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < workspace->children->length; ++i) {
|
|
|
|
|
|
|
|
((swayc_t *)workspace->children->items[i])->parent = cont;
|
|
|
|
|
|
|
|
}
|
|
|
|
//Swap children
|
|
|
|
//Swap children
|
|
|
|
list_t *tmp_list = workspace->children;
|
|
|
|
list_t *tmp_list = workspace->children;
|
|
|
|
workspace->children = cont->children;
|
|
|
|
workspace->children = cont->children;
|
|
|
@ -204,7 +206,7 @@ swayc_t *destroy_output(swayc_t *output) {
|
|
|
|
if (output->children->length == 0) {
|
|
|
|
if (output->children->length == 0) {
|
|
|
|
//TODO move workspaces to other outputs
|
|
|
|
//TODO move workspaces to other outputs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sway_log(L_DEBUG, "OUTPUT: Destroying output '%u'", (unsigned int)output->handle);
|
|
|
|
sway_log(L_DEBUG, "OUTPUT: Destroying output '%lu'", output->handle);
|
|
|
|
free_swayc(output);
|
|
|
|
free_swayc(output);
|
|
|
|
return &root_container;
|
|
|
|
return &root_container;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -246,7 +248,6 @@ swayc_t *destroy_view(swayc_t *view) {
|
|
|
|
if (parent->type == C_CONTAINER) {
|
|
|
|
if (parent->type == C_CONTAINER) {
|
|
|
|
return destroy_container(parent);
|
|
|
|
return destroy_container(parent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return parent;
|
|
|
|
return parent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|