efl_ui_focus_managr_sub: fix a err message

with this commit there are a few errors less, for the case a object is
destroyed while registered as a border element in the sub manager.
This adds a few more callbacks to the list of callbacks, however, i
could not messure a big performance impact.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10067
This commit is contained in:
Marcel Hollerbach 2019-09-21 11:09:24 +02:00 committed by Cedric Bail
parent 802f414b25
commit 63ebd0e9cc
1 changed files with 12 additions and 0 deletions

View File

@ -29,11 +29,22 @@ _set_a_without_b(Eina_List *a, Eina_List *b)
return a_out;
}
static void
_invalidate_cb(void *data, const Efl_Event *ev)
{
MY_DATA(data, pd);
EINA_SAFETY_ON_NULL_RETURN(pd);
pd->current_border = eina_list_remove(pd->current_border, ev->object);
}
static void
_register(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node, Efl_Ui_Focus_Object *logical)
{
if (par_m)
efl_ui_focus_manager_calc_register(par_m, node, logical, obj);
efl_event_callback_add(node, EFL_EVENT_INVALIDATE, _invalidate_cb, obj);
}
static void
@ -41,6 +52,7 @@ _unregister(Efl_Ui_Focus_Manager *obj EINA_UNUSED, Efl_Ui_Focus_Manager *par_m,
{
if (par_m)
efl_ui_focus_manager_calc_unregister(par_m, node);
efl_event_callback_del(node, EFL_EVENT_INVALIDATE, _invalidate_cb, obj);
}
static void