set/unset smart parent as e_widget when adding sub-objects

in the case where there is no smart parent, this fixes the object tree
and resolves some stacking issues. if there is a parent or a parent is added
later, nothing is changed

fixes eg. screenshot preview visibility in wayland
This commit is contained in:
Mike Blumenkrantz 2016-07-19 13:05:28 -04:00
parent 3e74bcb3d3
commit 5f9cbb1446
1 changed files with 4 additions and 0 deletions

View File

@ -164,6 +164,8 @@ e_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj)
if (e_widget_can_focus_get(sobj)) sd->child_can_focus = 1;
if (!evas_object_smart_parent_get(sobj))
evas_object_smart_member_add(sobj, obj);
if (strcmp(evas_object_type_get(sobj), SMART_NAME)) return;
sd = evas_object_smart_data_get(sobj);
@ -179,6 +181,8 @@ E_API void
e_widget_sub_object_del(Evas_Object *obj, Evas_Object *sobj)
API_ENTRY return;
if (evas_object_smart_parent_get(sobj) == obj)
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
sd->subobjs = eina_list_remove(sd->subobjs, sobj);
if (!sd->child_can_focus)