Tiling2: Better handle parent == NULL case.
authorTom Hacohen <tom@stosb.com>
Thu, 16 Jan 2014 12:39:36 +0000 (12:39 +0000)
committerTom Hacohen <tom@stosb.com>
Fri, 21 Feb 2014 09:15:07 +0000 (09:15 +0000)
src/modules/tiling/window_tree.c

index d4aa500..107ee41 100644 (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);