Tiling2: Better handle parent == NULL case.

This commit is contained in:
Tom Hacohen 2014-01-16 12:39:36 +00:00
parent 3804d5165a
commit ceb1cc414e
1 changed files with 5 additions and 0 deletions

View File

@ -91,6 +91,11 @@ tiling_window_tree_add(Window_Tree *root, Window_Tree *parent, E_Client *client,
else if (!parent)
{
parent = root;
parent_split_type = _tiling_window_tree_split_type_get(parent);
if ((parent_split_type != split_type) && (parent->children))
{
parent = (Window_Tree *) parent->children;
}
}
parent_split_type = _tiling_window_tree_split_type_get(parent);