From b75979c63c5af09597f3da02b9e11fa46c22cb01 Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Tue, 20 Feb 2018 15:10:21 +0100 Subject: [PATCH] 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 --- src/lib/elementary/efl_ui_focus_manager_calc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c index f41257d..e0e56b0 100644 --- a/src/lib/elementary/efl_ui_focus_manager_calc.c +++ b/src/lib/elementary/efl_ui_focus_manager_calc.c @@ -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 -- 2.7.4