/* If focused is NULL, it should return the root. */
Window_Tree *parent = tiling_window_tree_client_find(_G.tinfo->tree,
ec_focused);
- Window_Tree *new_node;
if (!parent)
{
if (_G.tinfo->tree && ec_focused)
parent = _G.tinfo->tree;
}
- new_node = tiling_window_tree_add(_G.tinfo->tree, parent, ec, _G.split_type);
- if (!_G.tinfo->tree)
- _G.tinfo->tree = new_node;
+ _G.tinfo->tree = tiling_window_tree_add(_G.tinfo->tree, parent, ec, _G.split_type);
}
_reapply_tree();
}
else
{
- /* FIXME: This is wrong. */
+ root = calloc(1, sizeof(*root));
_tiling_window_tree_split_add(parent, new_node);
+ root->weight = 1.0;
+ root->children = eina_inlist_append(root->children,
+ EINA_INLIST_GET(parent));
+ parent->parent = root;
}
}
- return new_node;
+ return root;
}
Window_Tree *