summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>2019-11-27 09:41:58 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-11-27 09:42:53 -0500
commit2ceaf9b657bda60fa94d8c42e1289d0f2469520e (patch)
tree8bddef98635ee594b9ec96c8e9fc44e9cd3ef6da
parent3d3fe1ebcf568cf49a29e637335f3fbc598daf84 (diff)
Revert "elm/genlist: remove calc jobs"
Summary: This reverts commit 712266fb9ae3e7cd2ea009189b2d94cd4ec333ab. Test Plan: run elementary_test -> genlist2 add more items by + and before/after button. if you delete selected items by click - button, issue cases, you can see item area become empty and not filled. if you click U button, so update items, issue cases, all item disappeared. the issue is caused by removing calc_job, so there is no job to performed, and loof is idled states. in Tizen, to solving this problem, we add dummy job in recalc cases. Need to see how to solve the issue more simply, but firstly raise the ticket to notify severe issue. Reviewers: zmike, cedric, bu5hm4n Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10663
-rw-r--r--src/lib/elementary/elm_genlist.c65
-rw-r--r--src/lib/elementary/elm_widget_genlist.h1
2 files changed, 40 insertions, 26 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 9f2fb8e4a0..f239873418 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -183,6 +183,14 @@ static const Elm_Action key_actions[] = {
183 {NULL, NULL} 183 {NULL, NULL}
184}; 184};
185 185
186static inline void
187_add_calc_job(Elm_Genlist_Data *sd)
188{
189 ELM_SAFE_FREE(sd->calc_job, ecore_job_del);
190 if (!efl_alive_get(sd->obj)) return;
191 sd->calc_job = ecore_job_add(_calc_job, sd->obj);
192}
193
186static void 194static void
187_size_cache_free(void *data) 195_size_cache_free(void *data)
188{ 196{
@@ -288,6 +296,7 @@ _elm_genlist_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Genlist_Pan_Data *psd,
288 296
289 psd->wsd->pan_changed = EINA_TRUE; 297 psd->wsd->pan_changed = EINA_TRUE;
290 evas_object_smart_changed(obj); 298 evas_object_smart_changed(obj);
299 ELM_SAFE_FREE(psd->wsd->calc_job, ecore_job_del);
291} 300}
292 301
293static void 302static void
@@ -323,7 +332,9 @@ _elm_genlist_pan_efl_gfx_entity_size_set(Eo *obj, Elm_Genlist_Pan_Data *psd, Ein
323 // away or appeared to queue a job to deal with it. it should settle in 332 // away or appeared to queue a job to deal with it. it should settle in
324 // the end to a steady-state 333 // the end to a steady-state
325 if (old.w != size.w) 334 if (old.w != size.w)
326 efl_canvas_group_change(sd->obj); 335 _add_calc_job(sd);
336 else
337 ELM_SAFE_FREE(sd->calc_job, ecore_job_del);
327 338
328super: 339super:
329 efl_gfx_entity_size_set(efl_super(obj, MY_PAN_CLASS), size); 340 efl_gfx_entity_size_set(efl_super(obj, MY_PAN_CLASS), size);
@@ -773,7 +784,7 @@ _must_recalc_idler(void *data)
773{ 784{
774 ELM_GENLIST_DATA_GET(data, sd); 785 ELM_GENLIST_DATA_GET(data, sd);
775 786
776 efl_canvas_group_change(sd->obj); 787 _add_calc_job(sd);
777 sd->must_recalc_idler = NULL; 788 sd->must_recalc_idler = NULL;
778 return ECORE_CALLBACK_CANCEL; 789 return ECORE_CALLBACK_CANCEL;
779} 790}
@@ -783,7 +794,7 @@ _calc_job(void *data)
783{ 794{
784 int in = 0; 795 int in = 0;
785 Item_Block *itb, *chb = NULL; 796 Item_Block *itb, *chb = NULL;
786 Elm_Genlist_Data *sd = data; 797 ELM_GENLIST_DATA_GET(data, sd);
787 Eina_Bool minw_change = EINA_FALSE; 798 Eina_Bool minw_change = EINA_FALSE;
788 Eina_Bool did_must_recalc = EINA_FALSE; 799 Eina_Bool did_must_recalc = EINA_FALSE;
789 Evas_Coord minw = -1, minh = 0, y = 0, ow = 0, vw = 0; 800 Evas_Coord minw = -1, minh = 0, y = 0, ow = 0, vw = 0;
@@ -896,7 +907,7 @@ _calc_job(void *data)
896 if (did_must_recalc) 907 if (did_must_recalc)
897 { 908 {
898 if (!sd->must_recalc_idler) 909 if (!sd->must_recalc_idler)
899 sd->must_recalc_idler = ecore_idler_add(_must_recalc_idler, sd->obj); 910 sd->must_recalc_idler = ecore_idler_add(_must_recalc_idler, data);
900 } 911 }
901 if (!sd->show_item) sd->check_scroll = EINA_FALSE; 912 if (!sd->show_item) sd->check_scroll = EINA_FALSE;
902 if (sd->check_scroll) 913 if (sd->check_scroll)
@@ -908,6 +919,7 @@ _calc_job(void *data)
908 _item_scroll(sd); 919 _item_scroll(sd);
909 } 920 }
910 921
922 sd->calc_job = NULL;
911 evas_object_smart_changed(sd->pan_obj); 923 evas_object_smart_changed(sd->pan_obj);
912 evas_event_thaw(e); 924 evas_event_thaw(e);
913 evas_event_thaw_eval(e); 925 evas_event_thaw_eval(e);
@@ -946,15 +958,11 @@ _elm_genlist_efl_canvas_group_group_calculate(Eo *obj, Elm_Genlist_Data *sd)
946 { 958 {
947 itb->must_recalc = EINA_TRUE; 959 itb->must_recalc = EINA_TRUE;
948 } 960 }
949 sd->need_calc = EINA_TRUE; 961 _add_calc_job(sd);
950 } 962 }
951 minw = vmw; 963 minw = vmw;
952 minh = vmh; 964 minh = vmh;
953 } 965 }
954 else
955 sd->need_calc = EINA_TRUE;
956 if (sd->need_calc)
957 _calc_job(sd);
958 966
959 if (sd->scr_minw) 967 if (sd->scr_minw)
960 { 968 {
@@ -2624,7 +2632,9 @@ _elm_genlist_pan_efl_canvas_group_group_calculate(Eo *obj, Elm_Genlist_Pan_Data
2624 2632
2625 if (sd->pan_changed) 2633 if (sd->pan_changed)
2626 { 2634 {
2627 _calc_job(sd); 2635 ecore_job_del(sd->calc_job);
2636 sd->calc_job = NULL;
2637 _calc_job(sd->obj);
2628 sd->pan_changed = EINA_FALSE; 2638 sd->pan_changed = EINA_FALSE;
2629 } 2639 }
2630 2640
@@ -3578,7 +3588,7 @@ _elm_genlist_efl_ui_widget_theme_apply(Eo *obj, Elm_Genlist_Data *sd)
3578 itb->changed = EINA_TRUE; 3588 itb->changed = EINA_TRUE;
3579 } 3589 }
3580 if (sd->obj && efl_finalized_get(obj)) 3590 if (sd->obj && efl_finalized_get(obj))
3581 efl_canvas_group_change(sd->obj); 3591 _add_calc_job(sd);
3582 elm_layout_sizing_eval(obj); 3592 elm_layout_sizing_eval(obj);
3583 evas_event_thaw(e); 3593 evas_event_thaw(e);
3584 evas_event_thaw_eval(e); 3594 evas_event_thaw_eval(e);
@@ -3700,8 +3710,8 @@ _item_block_del(Elm_Gen_Item *it)
3700 itb->items = eina_list_remove(itb->items, it); 3710 itb->items = eina_list_remove(itb->items, it);
3701 itb->count--; 3711 itb->count--;
3702 itb->changed = EINA_TRUE; 3712 itb->changed = EINA_TRUE;
3703 efl_canvas_group_change(sd->obj);
3704 if (itb->realized) efl_ui_focus_manager_calc_unregister(itb->sd->obj, EO_OBJ(it)); 3713 if (itb->realized) efl_ui_focus_manager_calc_unregister(itb->sd->obj, EO_OBJ(it));
3714 _add_calc_job(sd);
3705 if (itb->count < 1) 3715 if (itb->count < 1)
3706 { 3716 {
3707 Item_Block *itbn; 3717 Item_Block *itbn;
@@ -3769,6 +3779,8 @@ _item_block_del(Elm_Gen_Item *it)
3769 { 3779 {
3770 sd->pan_changed = EINA_TRUE; 3780 sd->pan_changed = EINA_TRUE;
3771 evas_object_smart_changed(sd->pan_obj); 3781 evas_object_smart_changed(sd->pan_obj);
3782 ecore_job_del(sd->calc_job);
3783 sd->calc_job = NULL;
3772 } 3784 }
3773} 3785}
3774 3786
@@ -3847,7 +3859,7 @@ _elm_genlist_item_del_serious(Elm_Gen_Item *it)
3847 sd->group_items = eina_list_remove(sd->group_items, it); 3859 sd->group_items = eina_list_remove(sd->group_items, it);
3848 3860
3849 ELM_SAFE_FREE(sd->state, eina_inlist_sorted_state_free); 3861 ELM_SAFE_FREE(sd->state, eina_inlist_sorted_state_free);
3850 efl_canvas_group_change(sd->obj); 3862 _add_calc_job(sd);
3851 3863
3852 ELM_SAFE_FREE(it->item, free); 3864 ELM_SAFE_FREE(it->item, free);
3853} 3865}
@@ -4049,9 +4061,7 @@ _item_mouse_move_cb(void *data,
4049 else 4061 else
4050 changed = _item_position(it, VIEW(it), it->item->scrl_x, y_pos); 4062 changed = _item_position(it, VIEW(it), it->item->scrl_x, y_pos);
4051 4063
4052 efl_canvas_group_change(sd->obj); 4064 _add_calc_job(sd);
4053 if (changed)
4054 efl_canvas_group_change(sd->pan_obj);
4055 } 4065 }
4056 return; 4066 return;
4057 } 4067 }
@@ -4655,7 +4665,7 @@ newblock:
4655 itb->count++; 4665 itb->count++;
4656 itb->changed = EINA_TRUE; 4666 itb->changed = EINA_TRUE;
4657 it->item->block = itb; 4667 it->item->block = itb;
4658 efl_canvas_group_change(itb->sd->obj); 4668 _add_calc_job(itb->sd);
4659 4669
4660 if (itb->count > itb->sd->max_items_per_block) 4670 if (itb->count > itb->sd->max_items_per_block)
4661 { 4671 {
@@ -4814,6 +4824,7 @@ _item_process_post(Elm_Genlist_Data *sd, Elm_Gen_Item *it)
4814 if (sd->pan_changed) 4824 if (sd->pan_changed)
4815 { 4825 {
4816 evas_object_smart_changed(sd->pan_obj); 4826 evas_object_smart_changed(sd->pan_obj);
4827 ELM_SAFE_FREE(sd->calc_job, ecore_job_del);
4817 } 4828 }
4818 } 4829 }
4819 if (show_me) it->item->block->show_me = EINA_TRUE; 4830 if (show_me) it->item->block->show_me = EINA_TRUE;
@@ -4899,7 +4910,7 @@ _item_idle_enterer(void *data)
4899 if (wakeup) 4910 if (wakeup)
4900 { 4911 {
4901 // wake up mainloop 4912 // wake up mainloop
4902 efl_canvas_group_change(sd->obj); 4913 _add_calc_job(sd);
4903 } 4914 }
4904 if (ok == ECORE_CALLBACK_CANCEL) sd->queue_idle_enterer = NULL; 4915 if (ok == ECORE_CALLBACK_CANCEL) sd->queue_idle_enterer = NULL;
4905 4916
@@ -5144,7 +5155,7 @@ _item_mouse_up_cb(void *data,
5144 } 5155 }
5145 else 5156 else
5146 { 5157 {
5147 efl_canvas_group_change(sd->obj); 5158 _add_calc_job(sd);
5148 } 5159 }
5149 edje_object_signal_emit(VIEW(it), SIGNAL_REORDER_DISABLED, "elm"); 5160 edje_object_signal_emit(VIEW(it), SIGNAL_REORDER_DISABLED, "elm");
5150 if (_elm_config->atspi_mode) 5161 if (_elm_config->atspi_mode)
@@ -5545,7 +5556,7 @@ _update_job(void *data)
5545 } 5556 }
5546 if (position) 5557 if (position)
5547 { 5558 {
5548 efl_canvas_group_change(sd->obj); 5559 _add_calc_job(sd);
5549 } 5560 }
5550 evas_event_thaw(e); 5561 evas_event_thaw(e);
5551 evas_event_thaw_eval(e); 5562 evas_event_thaw_eval(e);
@@ -5899,6 +5910,7 @@ _elm_genlist_efl_canvas_group_group_del(Eo *obj, Elm_Genlist_Data *sd)
5899 EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, 5910 EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE,
5900 _evas_viewport_resize_cb, sd); 5911 _evas_viewport_resize_cb, sd);
5901 5912
5913 ELM_SAFE_FREE(sd->calc_job, ecore_job_del);
5902 ELM_SAFE_FREE(sd->update_job, ecore_job_del); 5914 ELM_SAFE_FREE(sd->update_job, ecore_job_del);
5903 ELM_SAFE_FREE(sd->pan_obj, evas_object_del); 5915 ELM_SAFE_FREE(sd->pan_obj, evas_object_del);
5904 ELM_SAFE_FREE(sd->queue_idle_enterer, ecore_idle_enterer_del); 5916 ELM_SAFE_FREE(sd->queue_idle_enterer, ecore_idle_enterer_del);
@@ -6051,6 +6063,7 @@ _internal_elm_genlist_clear(Evas_Object *obj)
6051 sd->pan_changed = EINA_TRUE; 6063 sd->pan_changed = EINA_TRUE;
6052 if (!sd->queue) 6064 if (!sd->queue)
6053 { 6065 {
6066 ELM_SAFE_FREE(sd->calc_job, ecore_job_del);
6054 sd->anchor_item = NULL; 6067 sd->anchor_item = NULL;
6055 ELM_SAFE_FREE(sd->queue_idle_enterer, ecore_idle_enterer_del); 6068 ELM_SAFE_FREE(sd->queue_idle_enterer, ecore_idle_enterer_del);
6056 ELM_SAFE_FREE(sd->must_recalc_idler, ecore_idler_del); 6069 ELM_SAFE_FREE(sd->must_recalc_idler, ecore_idler_del);
@@ -7298,7 +7311,7 @@ _elm_genlist_item_coordinates_calc(Elm_Gen_Item *it,
7298 sd->scroll_to_type = type; 7311 sd->scroll_to_type = type;
7299 it->item->show_me = EINA_TRUE; 7312 it->item->show_me = EINA_TRUE;
7300 7313
7301 efl_canvas_group_change(sd->obj); 7314 _add_calc_job(sd);
7302 7315
7303 return EINA_FALSE; 7316 return EINA_FALSE;
7304 } 7317 }
@@ -7914,8 +7927,7 @@ _item_filtered_get(Elm_Gen_Item *it, Elm_Genlist_Data *sd)
7914 _filter_item_internal(it); 7927 _filter_item_internal(it);
7915 if (it->item->block) 7928 if (it->item->block)
7916 it->item->block->changed = EINA_TRUE; 7929 it->item->block->changed = EINA_TRUE;
7917 efl_canvas_group_change(sd->obj); 7930 _add_calc_job(sd);
7918 sd->need_calc = EINA_TRUE;
7919 } 7931 }
7920 return !it->hide; 7932 return !it->hide;
7921} 7933}
@@ -7973,7 +7985,7 @@ _item_filter_enterer(void *data)
7973 if (wakeup) 7985 if (wakeup)
7974 { 7986 {
7975 // wake up mainloop 7987 // wake up mainloop
7976 efl_canvas_group_change(sd->obj); 7988 _add_calc_job(sd);
7977 } 7989 }
7978 if (ok == ECORE_CALLBACK_CANCEL) 7990 if (ok == ECORE_CALLBACK_CANCEL)
7979 { 7991 {
@@ -8027,6 +8039,7 @@ _elm_genlist_filter_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, void *filter_
8027 } 8039 }
8028 } 8040 }
8029 } 8041 }
8042 _calc_job(sd->obj);
8030 if (!sd->filter_queue) 8043 if (!sd->filter_queue)
8031 efl_event_callback_legacy_call(sd->obj, ELM_GENLIST_EVENT_FILTER_DONE, NULL); 8044 efl_event_callback_legacy_call(sd->obj, ELM_GENLIST_EVENT_FILTER_DONE, NULL);
8032 else 8045 else
@@ -8282,7 +8295,7 @@ _elm_genlist_decorate_mode_set(Eo *obj, Elm_Genlist_Data *sd, Eina_Bool decorate
8282 } 8295 }
8283 } 8296 }
8284 8297
8285 efl_canvas_group_change(sd->obj); 8298 _add_calc_job(sd);
8286} 8299}
8287 8300
8288EOLIAN static void 8301EOLIAN static void
@@ -8428,7 +8441,7 @@ _flip_job(void *data)
8428 8441
8429 it->flipped = EINA_TRUE; 8442 it->flipped = EINA_TRUE;
8430 it->item->nocache = EINA_TRUE; 8443 it->item->nocache = EINA_TRUE;
8431 efl_canvas_group_change(sd->obj); 8444 _add_calc_job(sd);
8432} 8445}
8433 8446
8434EOLIAN static void 8447EOLIAN static void
diff --git a/src/lib/elementary/elm_widget_genlist.h b/src/lib/elementary/elm_widget_genlist.h
index 41aef7fa7e..e809934566 100644
--- a/src/lib/elementary/elm_widget_genlist.h
+++ b/src/lib/elementary/elm_widget_genlist.h
@@ -55,6 +55,7 @@ struct _Elm_Genlist_Data
55 Elm_Object_Item *last_selected_item; 55 Elm_Object_Item *last_selected_item;
56 Elm_Object_Item *focused_item; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */ 56 Elm_Object_Item *focused_item; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */
57 Elm_Object_Item *last_focused_item; /**< This records the last focused item when widget looses focus. This is required to set the focus on last focused item when widgets gets focus. */ 57 Elm_Object_Item *last_focused_item; /**< This records the last focused item when widget looses focus. This is required to set the focus on last focused item when widgets gets focus. */
58 Ecore_Job *calc_job;
58 int walking; 59 int walking;
59 int minw, minh; 60 int minw, minh;
60 unsigned int item_count; 61 unsigned int item_count;