aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/elm_widget.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2017-10-15 15:30:08 +0200
committerMarcel Hollerbach <marcel@osg.samsung.com>2017-10-16 11:02:13 +0200
commit0a814a0c716ff0f42da66ed7cb4e181ec5a5f983 (patch)
tree5afb4613075bf7e8b0566ca9eb9e3cac10197611 /src/lib/elementary/elm_widget.c
parentelm_widget: do not cache the provider (diff)
downloadefl-0a814a0c716ff0f42da66ed7cb4e181ec5a5f983.tar.gz
elm_widget: support logical parents that are not elm_widgets
Diffstat (limited to 'src/lib/elementary/elm_widget.c')
-rw-r--r--src/lib/elementary/elm_widget.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 0ac87aab04..cbcdd8fc2a 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -467,26 +467,32 @@ _logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
//update old logical parent;
if (pd->logical.parent)
{
- ELM_WIDGET_DATA_GET(pd->logical.parent, logical_wd);
- if (!logical_wd)
+ if (efl_isa(pd->logical.parent, ELM_WIDGET_CLASS))
{
- ERR("Widget parent has the wrong type!");
- return NULL;
+ ELM_WIDGET_DATA_GET(pd->logical.parent, logical_wd);
+ if (!logical_wd)
+ {
+ ERR("Widget parent has the wrong type!");
+ return NULL;
+ }
+ logical_wd->logical.child_count --;
}
- logical_wd->logical.child_count --;
old = pd->logical.parent;
efl_weak_unref(&pd->logical.parent);
pd->logical.parent = NULL;
}
if (parent)
{
- ELM_WIDGET_DATA_GET(parent, logical_wd);
- if (!logical_wd)
+ if (efl_isa(parent, ELM_WIDGET_CLASS))
{
- ERR("Widget parent has the wrong type!");
- return NULL;
+ ELM_WIDGET_DATA_GET(parent, parent_wd);
+ if (!parent_wd)
+ {
+ ERR("Widget parent has the wrong type!");
+ return NULL;
+ }
+ parent_wd->logical.child_count ++;
}
- logical_wd->logical.child_count ++;
pd->logical.parent = parent;
efl_weak_ref(&pd->logical.parent);
}
@@ -503,15 +509,14 @@ _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
old_parent = _logical_parent_eval(obj, pd);
- if (old_parent)
+ if (efl_isa(old_parent, ELM_WIDGET_CLASS))
{
//emit signal and focus eval old and new
ELM_WIDGET_DATA_GET(old_parent, old_pd);
_full_eval(old_parent, old_pd);
-
}
- if (pd->logical.parent)
+ if (efl_isa(pd->logical.parent, ELM_WIDGET_CLASS))
{
ELM_WIDGET_DATA_GET(pd->logical.parent, new_pd);
_full_eval(pd->logical.parent, new_pd);