From: Derek Foreman Date: Tue, 20 Nov 2018 17:20:36 +0000 (-0600) Subject: elm: Compress more focus tests into the same list walk X-Git-Tag: submit/tizen/20181205.064917~115 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a969aec5d5cd75278908f3f9ab7a358ad6d1d2b1;p=platform%2Fupstream%2Fefl.git elm: Compress more focus tests into the same list walk Since we're already at the top of the list, we can do the WIN_CLASS test much more cheaply. Differential Revision: https://phab.enlightenment.org/D7314 Signed-off-by: Derek Foreman --- diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 4519cb7..e39382a 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -430,18 +430,19 @@ _tree_custom_chain_missing(Eo *obj) } static Eina_Bool -_tree_disabled_or_unfocusable(Eo *obj) +_candidacy_exam(Eo *obj) { - Efl_Ui_Widget *wid = obj; + Efl_Ui_Widget *wid = obj, *top; do { ELM_WIDGET_DATA_GET(wid, wid_pd); if (wid_pd->disabled) return EINA_TRUE; if (wid_pd->tree_unfocusable) return EINA_TRUE; + top = wid; } while((wid = elm_widget_parent_get(wid))); - return EINA_FALSE; + return !efl_isa(top, EFL_UI_WIN_CLASS); } static void _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd); @@ -551,8 +552,7 @@ _eval_registration_candidate(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool *shou //can focus can be overridden by the following properties if ((!pd->parent_obj) || (!evas_object_visible_get(obj)) || - !efl_isa(elm_widget_top_get(obj), EFL_UI_WIN_CLASS) || - (_tree_disabled_or_unfocusable(obj)) || + (_candidacy_exam(obj)) || (_tree_custom_chain_missing(obj))) return;