efl_ui_focus_manager_calc: fallback to use root if the focus stack is empty

Summary: this patch fixes T6664

Test Plan:
1. elementary_test -to focus
2. click Disable button
3. check whether you can move focus using key event.

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric

Maniphest Tasks: T6664

Differential Revision: https://phab.enlightenment.org/D5813
This commit is contained in:
Yeongjong Lee 2018-02-20 15:10:21 +01:00 committed by Marcel Hollerbach
parent f6777aa4ac
commit e031867354
1 changed files with 4 additions and 2 deletions

View File

@ -1004,8 +1004,10 @@ _efl_ui_focus_manager_calc_unregister(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_
if (refocus)
{
Node *n = eina_list_last_data_get(pd->focus_stack);
if (n)
efl_ui_focus_object_focus_set(n->focusable, EINA_TRUE);
if (!n)
n = pd->root;
efl_ui_focus_object_focus_set(n->focusable, EINA_TRUE);
}
//add all neighbors of the node to the dirty list