evas: agressively freeze events on calculate callback and clear.
authorCedric BAIL <cedric@osg.samsung.com>
Sat, 6 Sep 2014 13:10:02 +0000 (15:10 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Sat, 6 Sep 2014 13:10:36 +0000 (15:10 +0200)
src/lib/evas/canvas/evas_object_box.c
src/lib/evas/canvas/evas_object_grid.c
src/lib/evas/canvas/evas_object_table.c

index ecdcf46..b28eff4 100644 (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);
index 941f1bc..8d153cd 100644 (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
index 7af2846..a9259a8 100644 (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