evas: agressively freeze events on calculate callback and clear.

This commit is contained in:
Cedric BAIL 2014-09-06 15:10:02 +02:00
parent 563bf84388
commit 532c598557
3 changed files with 29 additions and 2 deletions

View File

@ -436,10 +436,17 @@ _evas_box_evas_object_smart_calculate(Eo *o, Evas_Object_Box_Data *priv)
{
if (priv->layout.cb)
{
Evas *e;
e = evas_object_evas_get(o);
evas_event_freeze(e);
priv->layouting = 1;
priv->layout.cb(o, priv, priv->layout.data);
priv->layouting = 0;
priv->children_changed = EINA_FALSE;
evas_event_thaw(e);
}
else
ERR("No layout function set for %p box.", o);

View File

@ -208,11 +208,16 @@ _evas_object_grid_smart_calculate(Evas_Object *o)
{
Eina_List *l;
Evas_Object_Grid_Option *opt;
Evas *e;
Evas_Coord x, y, w, h, vw, vh;
Eina_Bool mirror;
EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(o, priv);
if (!priv->children) return;
e = evas_object_evas_get(o);
evas_event_freeze(e);
evas_object_geometry_get(o, &x, &y, &w, &h);
mirror = priv->is_mirrored;
vw = priv->size.w;
@ -220,7 +225,7 @@ _evas_object_grid_smart_calculate(Evas_Object *o)
EINA_LIST_FOREACH(priv->children, l, opt)
{
Evas_Coord x1, y1, x2, y2;
if (!mirror)
{
x1 = x + ((w * opt->x) / vw);
@ -236,6 +241,8 @@ _evas_object_grid_smart_calculate(Evas_Object *o)
evas_object_move(opt->obj, x1, y1);
evas_object_resize(opt->obj, x2 - x1, y2 - y1);
}
evas_event_thaw(e);
}
static void

View File

@ -936,6 +936,8 @@ _evas_table_evas_object_smart_resize(Eo *obj, Evas_Table_Data *_pd EINA_UNUSED,
EOLIAN static void
_evas_table_evas_object_smart_calculate(Eo *o, Evas_Table_Data *priv)
{
Evas *e;
if ((priv->size.cols < 1) || (priv->size.rows < 1))
{
DBG("Nothing to do: cols=%d, rows=%d",
@ -943,10 +945,15 @@ _evas_table_evas_object_smart_calculate(Eo *o, Evas_Table_Data *priv)
return;
}
e = evas_object_evas_get(o);
evas_event_freeze(e);
if (priv->homogeneous)
_evas_object_table_smart_calculate_homogeneous(o, priv);
else
_evas_object_table_smart_calculate_regular(o, priv);
evas_event_thaw(e);
}
EAPI Evas_Object *
@ -1261,6 +1268,10 @@ EOLIAN static void
_evas_table_clear(Eo *o, Evas_Table_Data *priv, Eina_Bool clear)
{
Evas_Object_Table_Option *opt;
Evas *e;
e = evas_object_evas_get(o);
evas_event_freeze(e);
EINA_LIST_FREE(priv->children, opt)
{
@ -1275,6 +1286,8 @@ _evas_table_clear(Eo *o, Evas_Table_Data *priv, Eina_Bool clear)
priv->size.rows = 0;
_evas_object_table_cache_invalidate(priv);
evas_object_smart_changed(o);
evas_event_thaw(e);
}
EOLIAN static void