static void _e_comp_wl_subsurface_place_above(E_Client *parent, E_Client *subc, E_Client *above);
static void _e_comp_wl_subsurface_place_below(E_Client *parent, E_Client *subc, E_Client *below);
static void _e_comp_wl_subsurface_stack_update(E_Client *ec);
+static void _e_comp_wl_subsurface_below_obj_destroy(E_Client *ec);
static E_Subsurface *_e_comp_wl_subsurface_create(struct wl_resource *resource, E_Client *ec, E_Client *epc, E_Client *offscreen_parent);
static void _e_comp_wl_subsurface_destroy(E_Subsurface *sub);
}
static void
-_e_comp_wl_subsurface_bg_evas_cb_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
+_e_comp_wl_subsurface_bg_cb_hook_del(void *data, E_Client *ec)
{
- Evas_Object *below_obj;
- E_Client *ec;
-
- below_obj = data;
- evas_object_del(below_obj);
+ if (!ec) return;
- ec = e_comp_object_client_get(obj);
- if ((ec) && (ec->comp_data))
+ if (ec->comp_data)
{
- ec->comp_data->sub.below_obj = NULL;
- if (ec->comp_data->sub.below_obj_map)
+ if (ec->comp_data->sub.below_obj)
{
- e_map_free(ec->comp_data->sub.below_obj_map);
- ec->comp_data->sub.below_obj_map = NULL;
+ ELOGF("COMP", "below_obj becomes useless by destroyed ec. argb(%d)", ec, ec->argb);
+ _e_comp_wl_subsurface_below_obj_destroy(ec);
}
- E_FREE_FUNC(ec->comp_data->sub.below_obj_map_transform_hook, e_client_hook_del);
}
-
- evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
- _e_comp_wl_subsurface_bg_evas_cb_del);
}
static Eina_Bool
e_client_hook_add(E_CLIENT_HOOK_TRANSFORM_CHANGE,
_e_comp_wl_subsurface_bg_cb_hook_transform_change,
ec);
+ ec->comp_data->sub.comp_wl_del_hook =
+ e_comp_wl_hook_add(E_COMP_WL_HOOK_DEL,
+ _e_comp_wl_subsurface_bg_cb_hook_del,
+ ec);
e_comp_wl_subsurface_bg_rectangle_map_apply(ec);
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_RESIZE,
_e_comp_wl_subsurface_bg_evas_cb_resize, ec);
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_DEL,
- _e_comp_wl_subsurface_bg_evas_cb_del, below_obj);
/* set alpha only if SW path */
e_comp_object_alpha_set(ec->frame, EINA_TRUE);
static void
_e_comp_wl_subsurface_below_obj_destroy(E_Client *ec)
{
+ if (!ec->comp_data) return;
+
ELOGF("COMP", " |bg_rectangle(%p) delete", ec, ec->comp_data->sub.below_obj);
- evas_object_event_callback_del(ec->frame, EVAS_CALLBACK_DEL,
- _e_comp_wl_subsurface_bg_evas_cb_del);
+
E_FREE_FUNC(ec->comp_data->sub.below_obj, evas_object_del);
if (ec->comp_data->sub.below_obj_map)
ec->comp_data->sub.below_obj_map = NULL;
}
E_FREE_FUNC(ec->comp_data->sub.below_obj_map_transform_hook, e_client_hook_del);
+ E_FREE_FUNC(ec->comp_data->sub.comp_wl_del_hook, e_comp_wl_hook_del);
}
static void