From 04f8ba7a72e18f4bc7113b654a0fa9dae4cabbd2 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Tue, 27 Oct 2020 11:27:16 +0900 Subject: [PATCH] subsurface: Add a function to link sub-surface to its parent. no functional change. Change-Id: Ic683c270587463be3640ff93a278f43daa7c572a --- src/bin/e_comp_wl_subsurface.c | 59 +++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/src/bin/e_comp_wl_subsurface.c b/src/bin/e_comp_wl_subsurface.c index 307ba2e..f2ba1bb 100644 --- a/src/bin/e_comp_wl_subsurface.c +++ b/src/bin/e_comp_wl_subsurface.c @@ -15,6 +15,7 @@ static void _e_comp_wl_subsurface_synchronized_commit(E_Client *ec); static void _e_comp_wl_subsurface_remove_from_parent(E_Client *parent, E_Client *subc); static void _e_comp_wl_subsurface_stack_update(E_Client *ec); static Eina_Bool _e_comp_wl_subsurface_empty_check(E_Client *ec); +static void _e_comp_wl_subsurface_parent_link(E_Comp_Wl_Subsurf_Data *sdata, E_Client *subc, E_Client *epc); static void _e_comp_wl_subsurface_cb_evas_restack(void *data, Evas *e, Evas_Object *obj, void *event_info); @@ -1026,7 +1027,6 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_ sdata->cached_buffer_ref.buffer = NULL; sdata->resource = res; sdata->synchronized = EINA_TRUE; - sdata->parent = epc; sdata->remote_surface.offscreen_parent = offscreen_parent; /* set subsurface client properties */ @@ -1044,29 +1044,7 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_ if (offscreen_parent) ELOGF("COMP", " |offscreen_parent:%p", ec, offscreen_parent); - if (epc->frame) - { - E_Layer layer = e_client_layer_get(epc); - if (layer > E_LAYER_BOTTOM) e_client_layer_set(ec, layer); - - if ((!_e_comp_wl_subsurface_data_get(epc)) && - (_e_comp_wl_subsurface_empty_check(epc))) - { - /* Add a callback function for restacking of topmost. */ - evas_object_event_callback_add(epc->frame, - EVAS_CALLBACK_RESTACK, - _e_comp_wl_subsurface_cb_evas_restack, - epc); - } - } - - if (epc->comp_data) - { - /* append this client to the parents subsurface list */ - epc->comp_data->sub.list_pending = - eina_list_append(epc->comp_data->sub.list_pending, ec); - epc->comp_data->sub.list_changed = EINA_TRUE; - } + _e_comp_wl_subsurface_parent_link(sdata, ec, epc); /* TODO: add callbacks ?? */ @@ -1498,3 +1476,36 @@ _e_comp_wl_subsurface_empty_check(E_Client *ec) (eina_list_count(ec->comp_data->sub.below_list) == 0) && (eina_list_count(ec->comp_data->sub.below_list_pending) == 0)); } + +static void +_e_comp_wl_subsurface_parent_link(E_Comp_Wl_Subsurf_Data *sdata, E_Client *subc, E_Client *epc) +{ + E_Layer layer; + + sdata->parent = epc; + + if (epc->frame) + { + layer = e_client_layer_get(epc); + if (layer > E_LAYER_BOTTOM) + e_client_layer_set(subc, layer); + + if ((!_e_comp_wl_subsurface_data_get(epc)) && + (_e_comp_wl_subsurface_empty_check(epc))) + { + /* Add a callback function for restacking of topmost. */ + evas_object_event_callback_add(epc->frame, + EVAS_CALLBACK_RESTACK, + _e_comp_wl_subsurface_cb_evas_restack, + epc); + } + } + + if (epc->comp_data) + { + /* append this client to the parents subsurface list */ + epc->comp_data->sub.list_pending = + eina_list_append(epc->comp_data->sub.list_pending, subc); + epc->comp_data->sub.list_changed = EINA_TRUE; + } +} -- 2.7.4