forked from enlightenment/enlightenment
Tiling2: When adding clients, add them relative to the current one.
This fixes clients to be added relative to the current one, and not at the end of the current children list. This fixes T944.
This commit is contained in:
parent
89881a0c50
commit
0831537efa
|
@ -45,7 +45,7 @@ _tiling_window_tree_split_add(Window_Tree *parent, Window_Tree *new_node)
|
|||
}
|
||||
|
||||
static void
|
||||
_tiling_window_tree_parent_add(Window_Tree *parent, Window_Tree *new_node)
|
||||
_tiling_window_tree_parent_add(Window_Tree *parent, Window_Tree *new_node, Window_Tree *rel)
|
||||
{
|
||||
/* Adjust existing children's weights */
|
||||
Window_Tree *itr;
|
||||
|
@ -62,7 +62,8 @@ _tiling_window_tree_parent_add(Window_Tree *parent, Window_Tree *new_node)
|
|||
}
|
||||
|
||||
parent->children =
|
||||
eina_inlist_append(parent->children, EINA_INLIST_GET(new_node));
|
||||
eina_inlist_append_relative(parent->children, EINA_INLIST_GET(new_node),
|
||||
EINA_INLIST_GET(rel));
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -83,6 +84,7 @@ Window_Tree *
|
|||
tiling_window_tree_add(Window_Tree *root, Window_Tree *parent,
|
||||
E_Client *client, Tiling_Split_Type split_type)
|
||||
{
|
||||
Window_Tree *orig_parent = parent;
|
||||
Window_Tree *new_node = calloc(1, sizeof(*new_node));
|
||||
|
||||
new_node->client = client;
|
||||
|
@ -113,7 +115,7 @@ tiling_window_tree_add(Window_Tree *root, Window_Tree *parent,
|
|||
{
|
||||
if (parent->children)
|
||||
{
|
||||
_tiling_window_tree_parent_add(parent, new_node);
|
||||
_tiling_window_tree_parent_add(parent, new_node, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -126,7 +128,7 @@ tiling_window_tree_add(Window_Tree *root, Window_Tree *parent,
|
|||
|
||||
if (grand_parent && grand_parent->children)
|
||||
{
|
||||
_tiling_window_tree_parent_add(grand_parent, new_node);
|
||||
_tiling_window_tree_parent_add(grand_parent, new_node, orig_parent);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue