summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJae Yong Hwang <j_yong.hwang@samsung.com>2014-09-06 01:47:55 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-09-06 01:47:55 +0900
commit4cedf6c0ebf41279bbbb587d3cbb0ad5db18c0d5 (patch)
tree00ccc15c0c01f59c059d808891b78607621f5496
parentad3bf295996c9eea73514fb60f873b6ab64ca45e (diff)
genlist: Fixed a crash bug in case of calling a genlist_clear in a select callback function.
Summary: If item select callback is elm_genlist_clear and genlist object have many item, elm_genlist_clear was broken. This reason is due to incorrect code. In Old code, check the item focus after an item was deleted. So, I changed the order of the code. Before item was deleted, Check the item focus. @fix Test Plan: I revised the elementary_test code and tested with that. Reviewers: raster, SanghyeonLee, seoz Reviewed By: seoz Subscribers: bluezery, SanghyeonLee Differential Revision: https://phab.enlightenment.org/D1418
-rw-r--r--src/lib/elm_genlist.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 882fcb1e3..297bcf3a3 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -5545,6 +5545,21 @@ _item_select(Elm_Gen_Item *it)
5545 _elm_genlist_item_content_focus_set(it, ELM_FOCUS_PREVIOUS); 5545 _elm_genlist_item_content_focus_set(it, ELM_FOCUS_PREVIOUS);
5546 } 5546 }
5547 5547
5548 if (!(sd->focus_on_selection_enabled || _elm_config->item_select_on_focus_disable))
5549 {
5550 Evas_Object *swallow_obj;
5551 Eina_List *l;
5552 EINA_LIST_FOREACH(it->content_objs, l, swallow_obj)
5553 {
5554 if (elm_widget_is(swallow_obj) && elm_object_focus_get(swallow_obj))
5555 {
5556 elm_object_focus_set(obj, EINA_FALSE);
5557 elm_object_focus_set(obj, EINA_TRUE);
5558 break;
5559 }
5560 }
5561 }
5562
5548 it->walking--; 5563 it->walking--;
5549 sd->walking--; 5564 sd->walking--;
5550 if ((sd->clear_me) && (!sd->walking)) 5565 if ((sd->clear_me) && (!sd->walking))
@@ -5560,20 +5575,6 @@ _item_select(Elm_Gen_Item *it)
5560 sd->last_selected_item = (Elm_Object_Item *)it; 5575 sd->last_selected_item = (Elm_Object_Item *)it;
5561 } 5576 }
5562 5577
5563 if (!(sd->focus_on_selection_enabled || _elm_config->item_select_on_focus_disable))
5564 {
5565 Evas_Object *swallow_obj;
5566 Eina_List *l;
5567 EINA_LIST_FOREACH(it->content_objs, l, swallow_obj)
5568 {
5569 if (elm_widget_is(swallow_obj) && elm_object_focus_get(swallow_obj))
5570 {
5571 elm_object_focus_set(obj, EINA_FALSE);
5572 elm_object_focus_set(obj, EINA_TRUE);
5573 break;
5574 }
5575 }
5576 }
5577 evas_object_unref(obj); 5578 evas_object_unref(obj);
5578} 5579}
5579 5580