elementary: reduce event generation during object creation by Efl.Ui.WidgetFactory.

We can not freeze the canvas in all scenario as we are sometime building widget fully
asynchronously which prevent holding events on the canvas. Still it is better to do it
for the case we can.

Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10685
This commit is contained in:
Cedric BAIL 2019-11-15 10:55:09 -08:00 committed by Marcel Hollerbach
parent 5cb8e4a3e7
commit b9e0d25a4c
1 changed files with 13 additions and 1 deletions

View File

@ -279,6 +279,10 @@ _efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data
{
Efl_Ui_Widget *w = NULL;
Eina_Value r;
Evas *e;
e = evas_object_evas_get(obj);
evas_event_freeze(e);
eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4);
@ -286,11 +290,19 @@ _efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data
{
w = _efl_ui_widget_create(obj, pd->klass, pd->parenting_widget, model);
if (!w) return efl_loop_future_rejected(obj, ENOMEM);
if (!w)
{
evas_event_thaw(e);
evas_event_thaw_eval(e);
return efl_loop_future_rejected(obj, ENOMEM);
}
eina_value_array_append(&r, w);
}
eina_iterator_free(models);
evas_event_thaw(e);
evas_event_thaw_eval(e);
return efl_loop_future_resolved(obj, r);
}