raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=253680f754f1165ff8b6397d378ecba4af8acc50

commit 253680f754f1165ff8b6397d378ecba4af8acc50
Author: Marcel Hollerbach <mar...@osg.samsung.com>
Date:   Fri Mar 2 13:13:24 2018 +0100

    efl_ui_focus_manager_calc: performe refocus after the node is deleted
    
    if node is the last element, the element will be focused again, and
    later deleted, without cleaning up the history
---
 src/lib/elementary/efl_ui_focus_manager_calc.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c 
b/src/lib/elementary/efl_ui_focus_manager_calc.c
index 773c25f521..f818c39600 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -79,6 +79,9 @@ typedef struct {
     Node *root;
 } Efl_Ui_Focus_Manager_Calc_Data;
 
+
+static Node* _request_subchild(Node *node);
+
 static void
 _manager_in_chain_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
 {
@@ -1001,15 +1004,6 @@ _efl_ui_focus_manager_calc_unregister(Eo *obj 
EINA_UNUSED, Efl_Ui_Focus_Manager_
    if (pd->redirect_entry == node->focusable)
      pd->redirect_entry = NULL;
 
-   if (refocus)
-     {
-        Node *n = eina_list_last_data_get(pd->focus_stack);
-        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
    for(int i = EFL_UI_FOCUS_DIRECTION_UP; i < EFL_UI_FOCUS_DIRECTION_LAST; i++)
      {
@@ -1026,6 +1020,16 @@ _efl_ui_focus_manager_calc_unregister(Eo *obj 
EINA_UNUSED, Efl_Ui_Focus_Manager_
    pd->dirty = eina_list_remove(pd->dirty, node);
 
    eina_hash_del_by_key(pd->node_hash, &child);
+
+   if (refocus)
+     {
+        Node *n = eina_list_last_data_get(pd->focus_stack);
+        if (!n)
+          n = pd->root;
+
+        if (_request_subchild(n))
+          efl_ui_focus_manager_focus_set(obj, n->focusable);
+     }
 }
 
 EOLIAN static void

-- 


Reply via email to