aboutsummaryrefslogtreecommitdiffstats
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
parentevas: Add more debug info to an ERR message (stack) (diff)
downloadefl-f1974b7b1c6a48cbdd3e485105bf1d6b96ed49a6.tar.gz
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 https://phab.enlightenment.org/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)
}
static void
+_item_restack(Elm_Gen_Item *it)
+{
+ ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
+
+ if (it->item->nostacking) return;
+ if ((it->item->order_num_in & 0x1) ^ it->item->stacking_even)
+ {
+ if (it->deco_all_view) evas_object_stack_below(it->deco_all_view, sd->stack[0]);
+ else if (it->item->deco_it_view) evas_object_stack_below(it->item->deco_it_view, sd->stack[0]);
+ else evas_object_stack_below(VIEW(it), sd->stack[0]);
+ }
+ else
+ {
+ if (it->deco_all_view) evas_object_stack_above(it->deco_all_view, sd->stack[0]);
+ else if (it->item->deco_it_view) evas_object_stack_above(it->item->deco_it_view, sd->stack[0]);
+ else evas_object_stack_above(VIEW(it), sd->stack[0]);
+ }
+}
+
+static void
_elm_genlist_item_position_state_update(Elm_Gen_Item *it)
{
unsigned idx = it->item->order_num_in;
@@ -1189,19 +1209,7 @@ _elm_genlist_item_position_state_update(Elm_Gen_Item *it)
if (!VIEW(it) && !it->deco_all_view) return;
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
- if (!it->item->nostacking)
- {
- if ((idx & 0x1) ^ it->item->stacking_even)
- {
- if (it->deco_all_view) evas_object_stack_below(it->deco_all_view, sd->stack[0]);
- else evas_object_stack_below(VIEW(it), sd->stack[0]);
- }
- else
- {
- if (it->deco_all_view) evas_object_stack_above(it->deco_all_view, sd->stack[0]);
- else evas_object_stack_above(VIEW(it), sd->stack[0]);
- }
- }
+ _item_restack(it);
if (idx & 0x1)
{
@@ -3504,29 +3512,13 @@ _item_highlight(Elm_Gen_Item *it)
static void
_item_unhighlight(Elm_Gen_Item *it)
{
- ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
-
if (!it->highlighted) return;
edje_object_signal_emit(VIEW(it), SIGNAL_UNSELECTED, "elm");
efl_event_callback_legacy_call(WIDGET(it), ELM_GENLIST_EVENT_UNHIGHLIGHTED, EO_OBJ(it));
if (it->deco_all_view)
- edje_object_signal_emit
- (it->deco_all_view, SIGNAL_UNSELECTED, "elm");
-
- if (!it->item->nostacking)
- {
- if ((it->item->order_num_in & 0x1) ^ it->item->stacking_even)
- {
- if (it->deco_all_view) evas_object_stack_below(it->deco_all_view, sd->stack[0]);
- else evas_object_stack_below(VIEW(it), sd->stack[0]);
- }
- else
- {
- if (it->deco_all_view) evas_object_stack_above(it->deco_all_view, sd->stack[0]);
- else evas_object_stack_above(VIEW(it), sd->stack[0]);
- }
- }
+ edje_object_signal_emit(it->deco_all_view, SIGNAL_UNSELECTED, "elm");
+ _item_restack(it);
it->highlighted = EINA_FALSE;
}