From: Jean-Philippe Andre Date: Fri, 24 Feb 2017 06:34:42 +0000 (+0900) Subject: genlist: Fix fileselector crazy behaviour X-Git-Tag: upstream/1.20.0~1894 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3574eb8c07b3ea04ba25d7ae9f6bf1df05c5b7d6;p=platform%2Fupstream%2Fefl.git genlist: Fix fileselector crazy behaviour When using the fileselector in tree view mode (ie. expandable), expanding any folder with a lot of files in it would cause the genlist view to jump somewhere to the bottom. This is because the mechanism preventing the view from moving was assuming that all "prepend" operations meant prepending before the selected item. This is not the case in case of expansion like in the fileselector. @fix --- diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index 44252ba..bd1219c 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -4663,7 +4663,7 @@ _item_process_post(Elm_Genlist_Data *sd, Elm_Gen_Item *it) * item this prevents the selected item being scrolled off the * viewport */ - if (sd->selected && it->item->before) + if (sd->selected && it->item->before && !it->hide) { int y = 0, h; Elm_Object_Item *eo_it2; @@ -4671,6 +4671,7 @@ _item_process_post(Elm_Genlist_Data *sd, Elm_Gen_Item *it) eo_it2 = sd->selected->data; ELM_GENLIST_ITEM_DATA_GET(eo_it2, it2); if (!it2->item->block) return; + if (it2->item->order_num_in < it->item->order_num_in) return; elm_interface_scrollable_content_pos_get(sd->obj, NULL, &y); evas_object_geometry_get(sd->pan_obj, NULL, NULL, NULL, &h); if ((it->y + it->item->block->y > y + h) ||