fix amazingly subtle e widget bug which crashed e whenever a subwidget of one object was set to be the subwidget of another object

SVN revision: 74350
This commit is contained in:
Mike Blumenkrantz 2012-07-24 09:46:33 +00:00
parent a563339dd3
commit e51cf14d4f
1 changed files with 8 additions and 10 deletions

View File

@ -143,23 +143,21 @@ e_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj)
if (eina_list_data_find(sd->subobjs, sobj)) return;
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
sd->subobjs = eina_list_append(sd->subobjs, sobj);
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
if (!sd->child_can_focus)
{
if (e_widget_can_focus_get(sobj)) sd->child_can_focus = 1;
}
if (!strcmp(evas_object_type_get(sobj), SMART_NAME))
if (strcmp(evas_object_type_get(sobj), SMART_NAME)) return;
sd = evas_object_smart_data_get(sobj);
if (sd)
{
sd = evas_object_smart_data_get(sobj);
if (sd)
{
if (sd->parent_obj) e_widget_sub_object_del(sd->parent_obj, sobj);
sd->parent_obj = obj;
}
if (sd->parent_obj) e_widget_sub_object_del(sd->parent_obj, sobj);
sd->parent_obj = obj;
}
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
}
EAPI void