summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-08-30 22:33:04 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-08-30 22:39:52 +0200
commitea5b0bdfdeab75db460d4d9ccdb49b8874bcce7e (patch)
treef8ac06539934530c6dcab5b6d6d2193f900ec2db
parent57d5b5921e8a4a05f4a1b468f1cfed74d28b95f9 (diff)
downloadefl-ea5b0bdfdeab75db460d4d9ccdb49b8874bcce7e.tar.gz
efl_ui_focus_manager: make logical_end work better
it turns out that we should also repsect logical elements that are having a redirect_manager, since they are more at the "end" then a potential regular node. The user now needs to handle the logical_end call on this manager, or handle at all what he wants to do with this information. efl_ui_win now handles it in the way that it just focuses that logical node, (which results in the redirect manager beeing set, then calling again logical_end on that manager. Repeating this until we have finally found a regular node that does fit out needs.
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.eo7
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c14
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_root_focus.c9
-rw-r--r--src/lib/elementary/efl_ui_win.c11
4 files changed, 29 insertions, 12 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager.eo b/src/lib/elementary/efl_ui_focus_manager.eo
index 546f9c38e1..cbfcfed47b 100644
--- a/src/lib/elementary/efl_ui_focus_manager.eo
+++ b/src/lib/elementary/efl_ui_focus_manager.eo
@@ -29,6 +29,11 @@ struct Efl.Ui.Focus.Relations {
redirect : Efl.Ui.Focus.Manager; [[Redirect manager]]
}
+struct Efl.Ui.Focus.Manager.Logical_End_Detail {
+ is_regular_end : bool;
+ element : Efl.Ui.Focus.Object;
+}
+
interface Efl.Ui.Focus.Manager {
[[Calculates the directions of Efl.Ui.Focus.Direction
@@ -123,7 +128,7 @@ interface Efl.Ui.Focus.Manager {
The returned object is the last object that would be returned if you start at the root and move the direction into next.
]]
- return : Efl.Ui.Focus.Object; [[Last object]]
+ return : Efl.Ui.Focus.Manager.Logical_End_Detail; [[Last object]]
}
reset_history {
[[Reset the history stack of this manager object.
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c
index e0b33cd7b6..dbd64c5d36 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -1460,21 +1460,23 @@ _efl_ui_focus_manager_calc_class_destructor(Efl_Class *c EINA_UNUSED)
_focus_log_domain = -1;
}
-EOLIAN static Efl_Ui_Focus_Object*
+EOLIAN static Efl_Ui_Focus_Manager_Logical_End_Detail
_efl_ui_focus_manager_calc_efl_ui_focus_manager_logical_end(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd)
{
Node *child = pd->root;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(child, NULL);
+ Efl_Ui_Focus_Manager_Logical_End_Detail ret = { 0, NULL};
+ EINA_SAFETY_ON_NULL_RETURN_VAL(child, ret);
//we need to return the most lower right element
- while(T(child).children)
+ while(T(child).children && !child->redirect_manager)
child = eina_list_last_data_get(T(child).children);
- while (child->type != NODE_TYPE_NORMAL)
+ while (child->type != NODE_TYPE_NORMAL && !child->redirect_manager)
child = _prev(child);
- return child ? child->focusable : NULL;
+ ret.is_regular_end = child->type == NODE_TYPE_NORMAL;
+ ret.element = child ? child->focusable : NULL;
+ return ret;
}
EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_focus_manager_root_focus.c b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
index cdb78fb17f..4736f4ac08 100644
--- a/src/lib/elementary/efl_ui_focus_manager_root_focus.c
+++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
@@ -85,10 +85,15 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_fetch(Eo *obj, Efl_Ui_Focu
}
-EOLIAN static Efl_Ui_Focus_Object *
+EOLIAN static Efl_Ui_Focus_Manager_Logical_End_Detail
_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_logical_end(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
{
- return _trap(pd, efl_ui_focus_manager_logical_end(efl_super(obj, MY_CLASS)));
+ Efl_Ui_Focus_Manager_Logical_End_Detail res;
+
+ res = efl_ui_focus_manager_logical_end(efl_super(obj, MY_CLASS));
+
+ res.element = _trap(pd, res.element);
+ return res;
}
EOLIAN static Eina_Iterator *
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index b5a64ddd21..1b2bb361aa 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -1755,10 +1755,15 @@ _key_action_move(Evas_Object *obj, const char *params)
if (!o && focus_dir == EFL_UI_FOCUS_DIRECTION_PREV)
{
- Efl_Ui_Focus_Object *last;
+ Efl_Ui_Focus_Manager_Logical_End_Detail last;
+ Efl_Ui_Focus_Manager *rec_manager = obj;
- last = efl_ui_focus_manager_logical_end(obj);
- efl_ui_focus_manager_focus_set(obj, last);
+ do {
+ last = efl_ui_focus_manager_logical_end(rec_manager);
+ efl_ui_focus_manager_focus_set(obj, last.element);
+
+ rec_manager = efl_ui_focus_manager_redirect_get(rec_manager);
+ } while (!last.is_regular_end);
}
return EINA_TRUE;