fix wm_treenode_remove_client
This commit is contained in:
parent
70d06f7888
commit
3742a49f32
11
src/util.c
11
src/util.c
@ -518,8 +518,14 @@ TreeNode* wm_treenode_remove_client(Wm *wm, TreeNode *root, Client *client)
|
|||||||
if (node->parent == NULL) {
|
if (node->parent == NULL) {
|
||||||
// parent is root node
|
// parent is root node
|
||||||
DEBUG_PRINT("parent is root node!\n");
|
DEBUG_PRINT("parent is root node!\n");
|
||||||
|
|
||||||
|
TreeNode old_root = *client->ws->tree;
|
||||||
|
|
||||||
sibling_node->parent = NULL;
|
sibling_node->parent = NULL;
|
||||||
client->ws->tree = sibling_node;
|
*client->ws->tree = *sibling_node;
|
||||||
|
|
||||||
|
wm_nodearray_free(old_root.children);
|
||||||
|
free(sibling_node);
|
||||||
|
|
||||||
client->ws->tree->pos = (Rect) {
|
client->ws->tree->pos = (Rect) {
|
||||||
.x = wm->config.border_width, .y = wm->config.border_width + dock_y ,
|
.x = wm->config.border_width, .y = wm->config.border_width + dock_y ,
|
||||||
@ -528,6 +534,9 @@ TreeNode* wm_treenode_remove_client(Wm *wm, TreeNode *root, Client *client)
|
|||||||
};
|
};
|
||||||
|
|
||||||
assert(client->ws->tree->children->size == 2);
|
assert(client->ws->tree->children->size == 2);
|
||||||
|
|
||||||
|
client->ws->tree->children->nodes[0]->parent = client->ws->tree;
|
||||||
|
client->ws->tree->children->nodes[1]->parent = client->ws->tree;
|
||||||
wm_treenode_split_space(client->ws->tree, &client->ws->tree->children->nodes[0]->pos,
|
wm_treenode_split_space(client->ws->tree, &client->ws->tree->children->nodes[0]->pos,
|
||||||
&client->ws->tree->children->nodes[1]->pos);
|
&client->ws->tree->children->nodes[1]->pos);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user