From ff77a2fa08dbf5e2e336a95b0ba8e2cf174edfe5 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 3 Nov 2014 11:45:47 -0500 Subject: [PATCH] e-comp-wl: Implement subsurface place_below function Signed-off-by: Chris Michael --- src/bin/e_comp_wl.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index a8ee1b0a7..2cd8f52ac 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1338,7 +1338,30 @@ _e_comp_wl_subsurface_cb_place_above(struct wl_client *client EINA_UNUSED, struc static void _e_comp_wl_subsurface_cb_place_below(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *sibling_resource) { + E_Client *ec, *ecs; + E_Client *parent; + DBG("Subsurface Cb Place Below: %d", wl_resource_get_id(resource)); + + /* try to get the client from resource data */ + if (!(ec = wl_resource_get_user_data(resource))) return; + + if (!ec->comp_data->sub.data) return; + + /* try to get the client from the sibling resource */ + if (!(ecs = wl_resource_get_user_data(sibling_resource))) return; + + if (!ecs->comp_data->sub.data) return; + + if (!(parent = ec->comp_data->sub.data->parent)) return; + + parent->comp_data->sub.list = + eina_list_remove(parent->comp_data->sub.list, ec); + + parent->comp_data->sub.list = + eina_list_prepend_relative(parent->comp_data->sub.list, ec, sibling); + + parent->comp_data->sub.restack_target = parent; } static void