bu5hm4n pushed a commit to branch master.

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

commit 67234dcde14291fdd0a357b30ed0e063d77bc552
Author: Marcel Hollerbach <mar...@osg.samsung.com>
Date:   Tue Oct 17 20:06:28 2017 +0200

    efl_ui_focus_manager_calc: reimplement move to be more compact & small
    
    this fixes a bug when a redirect was unset while going the prev
    direction.
---
 src/lib/elementary/efl_ui_focus_manager_calc.c | 31 +++++++++++---------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c 
b/src/lib/elementary/efl_ui_focus_manager_calc.c
index 7cc75a643a..033db69486 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -1405,31 +1405,26 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo 
*obj EINA_UNUSED, Efl_Ui
      {
         Efl_Ui_Focus_Object *old_candidate = NULL;
         candidate = efl_ui_focus_manager_move(pd->redirect, direction);
-        old_candidate = efl_ui_focus_manager_focus_get(pd->redirect);
 
         if (!candidate)
           {
              Efl_Ui_Focus_Object *new_candidate = NULL;
-             Node *n;
 
-             //there is no candidate check if we have something for that 
direction
-             new_candidate = NULL;
-             n = eina_hash_find(pd->node_hash, &old_candidate);
-
-             if (direction == EFL_UI_FOCUS_DIRECTION_NEXT ||
-                 direction == EFL_UI_FOCUS_DIRECTION_PREVIOUS)
+             if (DIRECTION_IS_LOGICAL(direction))
                {
-                 if (n)
-                   {
-                      n = T(n).parent;
-                      new_candidate = _request_move(obj, pd, direction, n);
-                      if (new_candidate)
-                        efl_ui_focus_manager_focus_set(obj, new_candidate);
-                      candidate = new_candidate;
-                   }
+                  // lets just take the last
+                  Node *n = eina_list_last_data_get(pd->focus_stack);
+                  new_candidate = _request_move(obj, pd, direction, n);
+                  if (new_candidate)
+                    efl_ui_focus_manager_focus_set(obj, new_candidate);
+                  candidate = new_candidate;
                }
              else
                {
+                  Node *n;
+
+                  old_candidate = efl_ui_focus_manager_focus_get(pd->redirect);
+                  n = eina_hash_find(pd->node_hash, &old_candidate);
 
                   if (n)
                     new_candidate = _request_move(obj, pd, direction, n);
@@ -1439,9 +1434,9 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo 
*obj EINA_UNUSED, Efl_Ui
                        //redirect does not have smth. but we do have.
                        efl_ui_focus_manager_focus_set(obj, new_candidate);
                     }
-                 candidate = new_candidate;
-               }
 
+                  candidate = new_candidate;
+               }
           }
      }
    else

-- 


Reply via email to