forked from enlightenment/efl
Eo: Optimise event callback call
check if the event is frozen before walking the event list
This commit is contained in:
parent
0bebaed0ac
commit
4b116627c2
|
@ -671,48 +671,45 @@ _eo_base_event_callback_call(Eo *obj_id, Eo_Base_Data *pd,
|
||||||
|
|
||||||
pd->walking_list++;
|
pd->walking_list++;
|
||||||
|
|
||||||
|
if (!desc->unfreezable && (event_freeze_count || pd->event_freeze_count))
|
||||||
|
goto end;
|
||||||
|
|
||||||
for (cb = pd->callbacks; cb; cb = cb->next)
|
for (cb = pd->callbacks; cb; cb = cb->next)
|
||||||
{
|
{
|
||||||
if (!cb->delete_me)
|
if (cb->delete_me)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (cb->func_array)
|
||||||
{
|
{
|
||||||
if (cb->func_array)
|
const Eo_Callback_Array_Item *it;
|
||||||
{
|
|
||||||
const Eo_Callback_Array_Item *it;
|
|
||||||
|
|
||||||
for (it = cb->items.item_array; it->func; it++)
|
for (it = cb->items.item_array; it->func; it++)
|
||||||
{
|
|
||||||
if (!_cb_desc_match(it->desc, desc))
|
|
||||||
continue;
|
|
||||||
if (!it->desc->unfreezable &&
|
|
||||||
(event_freeze_count || pd->event_freeze_count))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* Abort callback calling if the func says so. */
|
|
||||||
if (!it->func((void *) cb->func_data, obj_id, desc,
|
|
||||||
(void *) event_info))
|
|
||||||
{
|
|
||||||
ret = EINA_FALSE;
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (!_cb_desc_match(cb->items.item.desc, desc))
|
if (!_cb_desc_match(it->desc, desc))
|
||||||
continue;
|
|
||||||
if (!cb->items.item.desc->unfreezable &&
|
|
||||||
(event_freeze_count || pd->event_freeze_count))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Abort callback calling if the func says so. */
|
/* Abort callback calling if the func says so. */
|
||||||
if (!cb->items.item.func((void *) cb->func_data, obj_id, desc,
|
if (!it->func((void *) cb->func_data, obj_id, desc,
|
||||||
(void *) event_info))
|
(void *) event_info))
|
||||||
{
|
{
|
||||||
ret = EINA_FALSE;
|
ret = EINA_FALSE;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!_cb_desc_match(cb->items.item.desc, desc))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* Abort callback calling if the func says so. */
|
||||||
|
if (!cb->items.item.func((void *) cb->func_data, obj_id, desc,
|
||||||
|
(void *) event_info))
|
||||||
|
{
|
||||||
|
ret = EINA_FALSE;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
Loading…
Reference in New Issue