From a969aec5d5cd75278908f3f9ab7a358ad6d1d2b1 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 20 Nov 2018 11:20:36 -0600 Subject: [PATCH] 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 --- src/lib/elementary/efl_ui_widget.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; -- 2.7.4