seoz pushed a commit to branch master.
commit 699199222132c2c108c9716ac9eaf413b3c36cb8
Author: Daniel Juyung Seo <[email protected]>
Date: Mon Apr 8 19:28:01 2013 +0900
elc_ctxpopup.c: Do not calculate its size until parent is set.
We don't need to calculate ctxpopup's size until the parent is set.
Size will be calculated again after the parent is set.
---
src/lib/elc_ctxpopup.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c
index 5f7dcbe..b4eb092 100644
--- a/src/lib/elc_ctxpopup.c
+++ b/src/lib/elc_ctxpopup.c
@@ -154,7 +154,7 @@ _base_geometry_calc(Evas_Object *obj,
ELM_CTXPOPUP_DATA_GET(obj, sd);
Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (!rect) return ELM_CTXPOPUP_DIRECTION_DOWN;
+ if (!rect || !sd->parent) return ELM_CTXPOPUP_DIRECTION_DOWN;
edje_object_part_geometry_get
(sd->arrow, "ctxpopup_arrow", NULL, NULL, &arrow_size.x, &arrow_size.y);
@@ -164,7 +164,7 @@ _base_geometry_calc(Evas_Object *obj,
evas_object_geometry_get
(sd->parent, &hover_area.x, &hover_area.y, &hover_area.w,
&hover_area.h);
- if (sd->parent && !strcmp(evas_object_type_get(sd->parent), "elm_win"))
+ if (!strcmp(evas_object_type_get(sd->parent), "elm_win"))
hover_area.x = hover_area.y = 0;
evas_object_geometry_get(obj, &pos.x, &pos.y, NULL, NULL);
@@ -570,6 +570,7 @@ _elm_ctxpopup_smart_sizing_eval(Eo *obj, void *_pd, va_list
*list EINA_UNUSED)
Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!sd->arrow) return; /* simple way to flag "under deletion" */
+ if (!sd->parent) return; /* do not calculate sizes unless parent is set */
//Base
sd->dir = _base_geometry_calc(obj, &rect);
--
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html