bu5hm4n pushed a commit to branch master.

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

commit e8cfdb5dcd921aa9793c5cc42d966b2af1ac3ef3
Author: Marcel Hollerbach <[email protected]>
Date:   Tue Nov 21 16:15:46 2017 +0100

    efl_ui_focus_manager_calc: keep focus history arround
    
    this now keeps items arround even if a explicit other widget was
    focused. This is usefull if we have a few logical items on the focus
    stack and you remove them.
---
 src/lib/elementary/efl_ui_focus_manager_calc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c 
b/src/lib/elementary/efl_ui_focus_manager_calc.c
index c5e1d496f0..4e61fa1472 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -1344,8 +1344,8 @@ _request_subchild(Node *node)
 EOLIAN static void
 _efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, 
Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *focus)
 {
-   Node *node;
-   Efl_Ui_Focus_Object *last_focusable;
+   Node *node, *last;
+   Efl_Ui_Focus_Object *last_focusable = NULL;
    Efl_Ui_Focus_Manager *redirect_manager;
    Eo *focusable;
    Node_Type type;
@@ -1409,7 +1409,9 @@ 
_efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_
    type = node->type;
    focusable = node->focusable;
 
-   last_focusable = _focus_stack_unfocus_last(pd);
+   last = eina_list_last_data_get(pd->focus_stack);
+   if (last)
+     last_focusable = last->focusable;
 
    //remove the object from the list and add it again
    pd->focus_stack = eina_list_remove(pd->focus_stack, node);
@@ -1422,6 +1424,7 @@ 
_efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_
    if (node->type == NODE_TYPE_NORMAL)
      {
         //populate the new change
+        efl_ui_focus_object_focus_set(last_focusable, EINA_FALSE);
         efl_ui_focus_object_focus_set(node->focusable, EINA_TRUE);
         efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, 
last_focusable);
      }

-- 


Reply via email to