bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0d845057cc6b0e91286d2e7fe7849ccff76a9c38
commit 0d845057cc6b0e91286d2e7fe7849ccff76a9c38 Author: Mike Blumenkrantz <zm...@samsung.com> Date: Mon Oct 28 15:48:08 2019 -0400 elm/genlist: hide cached item contents and mark content unfocusable during calc cached item contents should already be hidden by the edje clipper, so this simply changes their visible state to break them out of the focus calcs contents must also be explicitly marked as unfocusable during calc-only realize operations in order to avoid triggering a full focus recalc which will error due to missing focus adapter in the item block Reviewed-by: Marcel Hollerbach <m...@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D10543 --- src/lib/elementary/elm_genlist.c | 29 ++++++++++++++++++++--------- src/lib/elementary/elm_widget_genlist.h | 1 + 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index 13e87fa5c6..40b644ea5d 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -469,7 +469,8 @@ _item_content_realize(Elm_Gen_Item *it, if (elm_widget_is(content)) { - if (!calc) + elm_widget_tree_unfocusable_set(content, it->item->unfocusable); + if (!calc && (!it->item->unfocusable)) _elm_widget_full_eval(content); } } @@ -1700,7 +1701,11 @@ _item_cache_find(Elm_Gen_Item *it) efl_wref_del(itc->base_view, &itc->base_view); itc->base_view = NULL; EINA_LIST_FREE(itc->contents, obj) - elm_widget_tree_unfocusable_set(obj, EINA_FALSE); + { + if (elm_widget_is(obj)) + elm_widget_tree_unfocusable_set(obj, it->item->unfocusable); + evas_object_show(obj); + } itc->contents = NULL; _item_cache_free(itc); return EINA_TRUE; @@ -1718,7 +1723,8 @@ _content_cache_add(Elm_Gen_Item *it, Eina_List **cache) { *cache = eina_list_append(*cache, content); eina_hash_del_by_key(pd->content_item_map, &content); - elm_widget_tree_unfocusable_set(content, EINA_TRUE); + if (elm_widget_is(content)) elm_widget_tree_unfocusable_set(content, EINA_TRUE); + evas_object_hide(content); } return *cache; @@ -5388,6 +5394,15 @@ _item_unrealize(Elm_Gen_Item *it) it->want_unrealize = EINA_FALSE; } +static void +_item_temp_realize(Elm_Gen_Item *it, const int index) +{ + it->item->unfocusable = EINA_TRUE; + _item_realize(it, index, EINA_TRUE); + _elm_genlist_item_unrealize(it, EINA_TRUE); + it->item->unfocusable = EINA_FALSE; +} + static Eina_Bool _item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd) { @@ -5421,8 +5436,7 @@ _item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd) { if (!size || (it->item->expanded_depth != size->expanded_depth)) { - _item_realize(it, blk_idx + vis_count, EINA_TRUE); - _elm_genlist_item_unrealize(it, EINA_TRUE); + _item_temp_realize(it, blk_idx + vis_count); } else { @@ -5443,10 +5457,7 @@ _item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd) it->item->mincalcd = EINA_TRUE; } else - { - _item_realize(it, blk_idx + vis_count, EINA_TRUE); - _elm_genlist_item_unrealize(it, EINA_TRUE); - } + _item_temp_realize(it, blk_idx + vis_count); } } else diff --git a/src/lib/elementary/elm_widget_genlist.h b/src/lib/elementary/elm_widget_genlist.h index 94b3b8465f..41aef7fa7e 100644 --- a/src/lib/elementary/elm_widget_genlist.h +++ b/src/lib/elementary/elm_widget_genlist.h @@ -253,6 +253,7 @@ struct Elm_Gen_Item_Type Eina_Bool queued : 1; Eina_Bool before : 1; Eina_Bool show_me : 1; + Eina_Bool unfocusable : 1; /* item is not focusable; propagate to content */ }; struct _Item_Block --