From ceb1cc414e6c616d134d08d7ddf78fe6e6d78132 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 16 Jan 2014 12:39:36 +0000 Subject: [PATCH] Tiling2: Better handle parent == NULL case. --- src/modules/tiling/window_tree.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/tiling/window_tree.c b/src/modules/tiling/window_tree.c index d4aa500ee..107ee41cb 100644 --- a/src/modules/tiling/window_tree.c +++ b/src/modules/tiling/window_tree.c @@ -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);