diff --git a/src/modules/tiling/e_mod_tiling.c b/src/modules/tiling/e_mod_tiling.c index e3d259ee0..7642b323b 100644 --- a/src/modules/tiling/e_mod_tiling.c +++ b/src/modules/tiling/e_mod_tiling.c @@ -482,7 +482,6 @@ _add_client(E_Client *ec) /* 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) @@ -493,9 +492,7 @@ _add_client(E_Client *ec) 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(); diff --git a/src/modules/tiling/window_tree.c b/src/modules/tiling/window_tree.c index 69cb37778..b722b6759 100644 --- a/src/modules/tiling/window_tree.c +++ b/src/modules/tiling/window_tree.c @@ -114,12 +114,16 @@ tiling_window_tree_add(Window_Tree *root, Window_Tree *parent, E_Client *client, } 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 *