elm_widget: also do not register if the top widget is not a win

this is currently quite a performance break, since that call is quite
heavy, lets see if we can optimize it later
This commit is contained in:
Marcel Hollerbach 2017-10-17 16:14:07 +02:00
parent 881815ec57
commit e2975a1fcb
1 changed files with 13 additions and 0 deletions

View File

@ -381,11 +381,18 @@ static void
_eval_registration_candidate(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool *should, Eina_Bool *want_full)
{
*should = *want_full = EINA_FALSE;
if (pd->can_focus)
{
*should = EINA_TRUE;
//can focus can be overridden by the following properties
if (!efl_isa(elm_widget_top_get(obj), EFL_UI_WIN_CLASS))
*should = EINA_FALSE;
if (!pd->parent_obj)
*should = EINA_FALSE;
if (_tree_unfocusable(obj))
*should = EINA_FALSE;
@ -403,6 +410,12 @@ _eval_registration_candidate(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool *shou
{
*should = EINA_TRUE;
if (!efl_isa(elm_widget_top_get(obj), EFL_UI_WIN_CLASS))
*should = EINA_FALSE;
if (!pd->parent_obj)
*should = EINA_FALSE;
if (_tree_unfocusable(obj))
*should = EINA_FALSE;