summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-03-13 20:18:33 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-03-14 11:04:16 +0900
commitf1974b7b1c6a48cbdd3e485105bf1d6b96ed49a6 (patch)
treed7a4fd5a53a7a615eea39bae92b10e5df9bda32f
parent5f3515542b57fcc97d848f4aae7804711e0b485a (diff)
genlist: Fix invalid call to stack above/below
Test process: elementary_test -to "Genlist Decorate Item Mode" Slide any item to the right, observe error logs. Ref T1551
-rw-r--r--src/lib/elementary/elm_genlist.c54
1 files changed, 23 insertions, 31 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 3197500492..a4b6908e79 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -1182,6 +1182,26 @@ _item_tree_effect_finish(Elm_Genlist_Data *sd)
1182} 1182}
1183 1183
1184static void 1184static void
1185_item_restack(Elm_Gen_Item *it)
1186{
1187 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
1188
1189 if (it->item->nostacking) return;
1190 if ((it->item->order_num_in & 0x1) ^ it->item->stacking_even)
1191 {
1192 if (it->deco_all_view) evas_object_stack_below(it->deco_all_view, sd->stack[0]);
1193 else if (it->item->deco_it_view) evas_object_stack_below(it->item->deco_it_view, sd->stack[0]);
1194 else evas_object_stack_below(VIEW(it), sd->stack[0]);
1195 }
1196 else
1197 {
1198 if (it->deco_all_view) evas_object_stack_above(it->deco_all_view, sd->stack[0]);
1199 else if (it->item->deco_it_view) evas_object_stack_above(it->item->deco_it_view, sd->stack[0]);
1200 else evas_object_stack_above(VIEW(it), sd->stack[0]);
1201 }
1202}
1203
1204static void
1185_elm_genlist_item_position_state_update(Elm_Gen_Item *it) 1205_elm_genlist_item_position_state_update(Elm_Gen_Item *it)
1186{ 1206{
1187 unsigned idx = it->item->order_num_in; 1207 unsigned idx = it->item->order_num_in;
@@ -1189,19 +1209,7 @@ _elm_genlist_item_position_state_update(Elm_Gen_Item *it)
1189 if (!VIEW(it) && !it->deco_all_view) return; 1209 if (!VIEW(it) && !it->deco_all_view) return;
1190 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 1210 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
1191 1211
1192 if (!it->item->nostacking) 1212 _item_restack(it);
1193 {
1194 if ((idx & 0x1) ^ it->item->stacking_even)
1195 {
1196 if (it->deco_all_view) evas_object_stack_below(it->deco_all_view, sd->stack[0]);
1197 else evas_object_stack_below(VIEW(it), sd->stack[0]);
1198 }
1199 else
1200 {
1201 if (it->deco_all_view) evas_object_stack_above(it->deco_all_view, sd->stack[0]);
1202 else evas_object_stack_above(VIEW(it), sd->stack[0]);
1203 }
1204 }
1205 1213
1206 if (idx & 0x1) 1214 if (idx & 0x1)
1207 { 1215 {
@@ -3504,29 +3512,13 @@ _item_highlight(Elm_Gen_Item *it)
3504static void 3512static void
3505_item_unhighlight(Elm_Gen_Item *it) 3513_item_unhighlight(Elm_Gen_Item *it)
3506{ 3514{
3507 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
3508
3509 if (!it->highlighted) return; 3515 if (!it->highlighted) return;
3510 3516
3511 edje_object_signal_emit(VIEW(it), SIGNAL_UNSELECTED, "elm"); 3517 edje_object_signal_emit(VIEW(it), SIGNAL_UNSELECTED, "elm");
3512 efl_event_callback_legacy_call(WIDGET(it), ELM_GENLIST_EVENT_UNHIGHLIGHTED, EO_OBJ(it)); 3518 efl_event_callback_legacy_call(WIDGET(it), ELM_GENLIST_EVENT_UNHIGHLIGHTED, EO_OBJ(it));
3513 if (it->deco_all_view) 3519 if (it->deco_all_view)
3514 edje_object_signal_emit 3520 edje_object_signal_emit(it->deco_all_view, SIGNAL_UNSELECTED, "elm");
3515 (it->deco_all_view, SIGNAL_UNSELECTED, "elm"); 3521 _item_restack(it);
3516
3517 if (!it->item->nostacking)
3518 {
3519 if ((it->item->order_num_in & 0x1) ^ it->item->stacking_even)
3520 {
3521 if (it->deco_all_view) evas_object_stack_below(it->deco_all_view, sd->stack[0]);
3522 else evas_object_stack_below(VIEW(it), sd->stack[0]);
3523 }
3524 else
3525 {
3526 if (it->deco_all_view) evas_object_stack_above(it->deco_all_view, sd->stack[0]);
3527 else evas_object_stack_above(VIEW(it), sd->stack[0]);
3528 }
3529 }
3530 it->highlighted = EINA_FALSE; 3522 it->highlighted = EINA_FALSE;
3531} 3523}
3532 3524