Fix the bug which the callbacks of the sub-object are added even if the sub-object...
authorJaehwan Kim <jae.hwan.kim.neo@gmail.com>
Thu, 3 Jan 2013 09:52:57 +0000 (09:52 +0000)
committerJaehwan Kim <jae.hwan.kim.neo@gmail.com>
Thu, 3 Jan 2013 09:52:57 +0000 (09:52 +0000)
SVN revision: 82053

ChangeLog
NEWS
src/lib/elm_flip.c
src/lib/elm_hover.c
src/lib/elm_layout.c

index 691281a..c7e01dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2013-01-03  Thiep Ha
 
         * Fix list separator size bug.
+
+2013-01-03  Jaehwan Kim
+
+        * Fix the bug which the callbacks of the sub-object are added even if the sub-object is added the parent object.
diff --git a/NEWS b/NEWS
index c018d8e..5ea0fcd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -109,6 +109,7 @@ Fixes:
    * Tooltips now correctly set NETWM tooltip window type
    * Fix the naviframe item part text to be set properly.
    * Fix list separator size bug.
+   * Fix the bug which the callbacks of the sub-object are added even if the sub-object is added the parent object.
 
 Removals:
 
index 95cdb6e..0c99293 100644 (file)
@@ -144,6 +144,9 @@ _elm_flip_smart_sub_object_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
    Eina_Bool int_ret;
    if (ret) *ret = EINA_FALSE;
 
+   if (evas_object_data_get(sobj, "elm-parent") == obj)
+     goto end;
+
    eo_do_super(obj, elm_wdg_sub_object_add(sobj, &int_ret));
    if (!int_ret) return;
 
@@ -152,6 +155,7 @@ _elm_flip_smart_sub_object_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
    evas_object_event_callback_add
      (sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints_cb, obj);
 
+end:
    if (ret) *ret = EINA_TRUE;
 }
 
index 20a03b8..48bc424 100644 (file)
@@ -331,6 +331,9 @@ _elm_hover_smart_sub_object_add(Eo *obj, void *_pd, va_list *list)
    Eina_Bool int_ret;
    Elm_Hover_Smart_Data *sd = _pd;
 
+   if (evas_object_data_get(sobj, "elm-parent") == obj)
+     goto end;
+
    eo_do_super(obj, elm_wdg_sub_object_add(sobj, &int_ret));
    if (!int_ret) return;
 
@@ -338,6 +341,7 @@ _elm_hover_smart_sub_object_add(Eo *obj, void *_pd, va_list *list)
      evas_object_event_callback_add
        (sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_smt_sub_changed, obj);
 
+end:
    if (ret) *ret = EINA_TRUE;
 }
 
index 65653a1..6abb965 100644 (file)
@@ -418,9 +418,11 @@ _elm_layout_smart_sub_object_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
    Evas_Object *sobj = va_arg(*list, Evas_Object *);
    Eina_Bool *ret = va_arg(*list, Eina_Bool *);
    if (ret) *ret = EINA_FALSE;
-
    Eina_Bool int_ret = EINA_FALSE;
 
+   if (evas_object_data_get(sobj, "elm-parent") == obj)
+     goto end;
+
    eo_do_super(obj, elm_wdg_sub_object_add(sobj, &int_ret));
    if (!int_ret) return;
 
@@ -432,6 +434,7 @@ _elm_layout_smart_sub_object_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
        (sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
          _on_sub_object_size_hint_change, obj);
 
+end:
    if (ret) *ret = EINA_TRUE;
 }