summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-09-03 09:41:35 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-09-03 09:42:31 +0100
commit9544c874289afd6f6eba894bde3c806ca22dda7b (patch)
tree1a50a4cd5fb7070adf3dc908bcd1505ad7f10b0d
parent5065c9d0c2c4202ef4e2fd7eed650681fc51bf27 (diff)
downloadefl-9544c874289afd6f6eba894bde3c806ca22dda7b.tar.gz
edje - calc - handle swallow disappearing mid-calc due to callabcks
callbacks attached to move/resize etc. can change a swallow and .. well.. i hit a crash where it happens. so handle this case. @fix
-rw-r--r--src/lib/edje/edje_calc.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index eed9215b23..221e7b645d 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -4761,7 +4761,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
}
if (!ed->calc_only)
{
- Evas_Object *mo;
+ Evas_Object *mo = NULL;
/* Common move, resize and color_set for all part. */
switch (ep->part->type)
@@ -4945,12 +4945,17 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
if (ep->part->type == EDJE_PART_TYPE_GROUP)
vis = evas_object_visible_get(ed->obj);
- efl_gfx_entity_position_set(ep->typedata.swallow->swallowed_object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
- efl_gfx_entity_size_set(ep->typedata.swallow->swallowed_object, EINA_SIZE2D(pf->final.w, pf->final.h));
- efl_gfx_entity_visible_set(ep->typedata.swallow->swallowed_object, vis);
+ if (ep->typedata.swallow)
+ efl_gfx_entity_position_set(ep->typedata.swallow->swallowed_object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
+ if (ep->typedata.swallow)
+ efl_gfx_entity_size_set(ep->typedata.swallow->swallowed_object, EINA_SIZE2D(pf->final.w, pf->final.h));
+ if (ep->typedata.swallow)
+ efl_gfx_entity_visible_set(ep->typedata.swallow->swallowed_object, vis);
}
- else evas_object_hide(ep->typedata.swallow->swallowed_object);
- mo = ep->typedata.swallow->swallowed_object;
+ else if (ep->typedata.swallow)
+ evas_object_hide(ep->typedata.swallow->swallowed_object);
+ if (ep->typedata.swallow)
+ mo = ep->typedata.swallow->swallowed_object;
}
else mo = ep->object;
if (ep->part->type != EDJE_PART_TYPE_SPACER)