summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-05-10 23:37:03 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-05-10 23:44:28 +0900
commitb156b600fa32a4fa58f2e0bbd8e41079b8ec6527 (patch)
treea9aeb5b53cf982755c5e7951c9991afa5065da7a
parent173930811883621143f40f74ad57db8c3b9ea859 (diff)
downloadelementary-b156b600fa32a4fa58f2e0bbd8e41079b8ec6527.tar.gz
list: initialize some internal variables on item free not item del pre.
This fixes variable initialize problems related to focus. This can be reproduced when you enable focus highlight/animation and reuse elm_list by clearing it. This problem occurred because list item del pre is never been called. This bug will be addressed in a next commit.
-rw-r--r--src/lib/elm_list.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 050897871..dedc4a1f5 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -73,6 +73,18 @@ static const Elm_Action key_actions[] = {
static inline void
_elm_list_item_free(Elm_List_Item *it)
{
+ ELM_LIST_DATA_GET(WIDGET(it), sd);
+
+ if (sd->focused_item == (Elm_Object_Item *)it)
+ sd->focused_item = NULL;
+ if (sd->last_focused_item == (Elm_Object_Item *)it)
+ sd->last_focused_item = NULL;
+ if (sd->prev_focused_item == (Elm_Object_Item *)it)
+ sd->prev_focused_item = NULL;
+ if (sd->last_selected_item == (Elm_Object_Item *)it)
+ sd->last_selected_item = NULL;
+
+
evas_object_event_callback_del_full
(VIEW(it), EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, it);
evas_object_event_callback_del_full
@@ -1881,15 +1893,6 @@ _item_del_pre_hook(Elm_Object_Item *it)
sd->items = eina_list_remove_list(sd->items, item->node);
- if (sd->focused_item == (Elm_Object_Item *)it)
- sd->focused_item = NULL;
- if (sd->last_focused_item == (Elm_Object_Item *)it)
- sd->last_focused_item = NULL;
- if (sd->prev_focused_item == (Elm_Object_Item *)it)
- sd->prev_focused_item = NULL;
- if (sd->last_selected_item == (Elm_Object_Item *)it)
- sd->last_selected_item = NULL;
-
evas_object_ref(obj);
_elm_list_walk(sd);