Fix to not click item on genlist 93/157293/1
authorWonnam Jang <wn.jang@samsung.com>
Tue, 24 Oct 2017 06:02:04 +0000 (15:02 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Tue, 24 Oct 2017 06:02:04 +0000 (15:02 +0900)
Change-Id: I0987fc633912337c12b67f1a379c8bf45de04e55
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
src/vc_elm_core.c

index c285b55..c92e445 100644 (file)
@@ -1604,7 +1604,7 @@ static void __unwrap_universal_item_command(struct Wrapped_Command *wrapper, con
                        if (0 == strcmp(_get_ui_object_name(parent), "Elm_Genlist")) {
                                evas_object_geometry_get(_vc_elm_core_get_evas_object(item), &x, &y, &w, &h);
                                evas_object_geometry_get(parent, &x_p, &y_p, &w_p, &h_p);
-                               if (y > h_p || y < y_p) {
+                               if (y > y_p + h_p || y < y_p) {
                                        evas_object_smart_callback_add(parent, "scroll,anim,stop", __activate_invisible_item_cb, (void*)unwr);
                                        elm_genlist_item_bring_in(item, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
                                } else {
@@ -1637,7 +1637,7 @@ static void __unwrap_universal_item_command(struct Wrapped_Command *wrapper, con
                evas_object_geometry_get(_vc_elm_core_get_evas_object(parent_item), &x, &y, &w, &h);
                evas_object_geometry_get(elm_object_parent_widget_get(_vc_elm_core_get_evas_object(parent_item)), &x_p, &y_p, &w_p, &h_p);
 
-               if (y > h_p || y < y_p) {
+               if (y > y_p + h_p || y < y_p) {
                        evas_object_smart_callback_add(elm_object_parent_widget_get(_vc_elm_core_get_evas_object(parent_item)), "scroll,anim,stop", __activate_invisible_item_cb, (void*)unwr);
                        elm_genlist_item_bring_in(parent_item, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
                        return;
@@ -1660,6 +1660,7 @@ static void __item__object_del_callback(void *data, Evas_Object *obj, void *even
 {
        struct Custom_Data *cdata;
        Elm_Object_Item *obj_item = (Elm_Object_Item *)event_info;
+       char* command = (char*)eina_hash_find(item_command_map, &obj_item);
 
        (void)data;
        (void)obj;
@@ -1667,6 +1668,7 @@ static void __item__object_del_callback(void *data, Evas_Object *obj, void *even
        eina_hash_free_cb_set(item_hint_map, __hash_entry_dummy_cb);
        eina_hash_free_cb_set(item_command_map, __hash_entry_dummy_cb);
        eina_hash_free_cb_set(item_custom_map, __hash_entry_dummy_cb);
+       eina_hash_free_cb_set(command_item_map, __hash_entry_dummy_cb);
 
        eina_stringshare_del((char *)eina_hash_find(item_hint_map, &obj_item));
        eina_stringshare_del((char *)eina_hash_find(item_command_map, &obj_item));
@@ -1677,10 +1679,12 @@ static void __item__object_del_callback(void *data, Evas_Object *obj, void *even
        eina_hash_del(item_hint_map, &obj_item, NULL);
        eina_hash_del(item_command_map, &obj_item, NULL);
        eina_hash_del(item_custom_map, &obj_item, NULL);
+       eina_hash_del(command_item_map, command, NULL);
 
        eina_hash_free_cb_set(item_hint_map, __hash_entry_free_cb);
        eina_hash_free_cb_set(item_command_map, __hash_entry_free_cb);
        eina_hash_free_cb_set(item_custom_map, __hash_entry_free_cb);
+       eina_hash_free_cb_set(command_item_map, __hash_entry_free_cb);
 }
 
 Eina_Bool _vc_elm_core_set_object_command(Evas_Object *obj, const char *_command)
@@ -1756,12 +1760,16 @@ static Eina_Bool _vc_elm_core_set_auto_item_object_command(Elm_Object_Item *obj,
 
 Eina_Bool _vc_elm_core_unset_item_object_command(Elm_Object_Item *obj)
 {
+       char* command = (char*)eina_hash_find(item_command_map, &obj);
        eina_hash_free_cb_set(item_command_map, __hash_entry_dummy_cb);
+       eina_hash_free_cb_set(command_item_map, __hash_entry_dummy_cb);
 
        eina_stringshare_del((char *)eina_hash_find(item_command_map, &obj));
        eina_hash_del(item_command_map, &obj, NULL);
+       eina_hash_del(command_item_map, command, NULL);
 
        eina_hash_free_cb_set(item_command_map, __hash_entry_free_cb);
+       eina_hash_free_cb_set(command_item_map, __hash_entry_dummy_cb);
 
        return EINA_TRUE;
 }