}
if ((w_diff != 1.0) || (h_diff != 1.0))
{
- tiling_window_tree_node_resize(item, w_dir, w_diff, h_dir, h_diff);
+ if (!tiling_window_tree_node_resize(item, w_dir, w_diff, h_dir, h_diff))
+ {
+ /* FIXME: Do something? */
+ }
}
}
return (Window_Tree *) EINA_INLIST_GET(it)->prev;
}
-static void
+static Eina_Bool
_tiling_window_tree_node_resize_direction(Window_Tree *node, Window_Tree *parent,
double dir_diff, int dir)
{
itr = itr_func(itr);
}
+ /* If it's at the edge, try the grandpa of the parent. */
if (weight == 0.0)
- return;
+ {
+ if (parent->parent && parent->parent->parent)
+ {
+ return _tiling_window_tree_node_resize_direction(parent->parent,
+ parent->parent->parent,
+ 1.0 + ((dir_diff - 1.) * node->weight),
+ dir);
+ }
+ return EINA_FALSE;
+ }
weight_diff = itr->weight;
itr->weight *= dir_diff;
{
itr->weight += itr->weight * weight_diff;
}
+
+ return EINA_TRUE;
}
-void
+Eina_Bool
tiling_window_tree_node_resize(Window_Tree *node, int w_dir, double w_diff, int h_dir, double h_diff)
{
Window_Tree *parent = node->parent;
Window_Tree *w_parent, *h_parent;
+ Eina_Bool ret = EINA_FALSE;
/* If we have no parent, means we need to be full screen anyway. */
if (!parent)
- return;
+ return EINA_FALSE;
Window_Tree *grand_parent = parent->parent;
Tiling_Split_Type parent_split_type = _tiling_window_tree_split_type_get(parent);
if ((h_diff != 1.0) && h_parent)
{
Window_Tree *tmp_node = (h_parent == parent) ? node : parent;
- _tiling_window_tree_node_resize_direction(tmp_node, h_parent, h_diff, h_dir);
+ ret = ret || _tiling_window_tree_node_resize_direction(tmp_node, h_parent, h_diff, h_dir);
}
if ((w_diff != 1.0) && w_parent)
{
Window_Tree *tmp_node = (w_parent == parent) ? node : parent;
- _tiling_window_tree_node_resize_direction(tmp_node, w_parent, w_diff, w_dir);
+ ret = ret || _tiling_window_tree_node_resize_direction(tmp_node, w_parent, w_diff, w_dir);
}
+
+ return ret;
}
void
void tiling_window_tree_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
-void tiling_window_tree_node_resize(Window_Tree *node, int w_dir, double w_diff, int h_dir, double h_diff);
+Eina_Bool tiling_window_tree_node_resize(Window_Tree *node, int w_dir, double w_diff, int h_dir, double h_diff);
#endif