aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-08-09 10:50:44 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-08-14 15:00:58 +0200
commitf21cf89a2fbe156a8ac3d33ecd481eb34bb2db28 (patch)
tree060cb2a5a7d5c0d9b49b9dd60debea71fbabb399
parentefl_ui_focus_manager: adjust pop history pop (diff)
downloadefl-f21cf89a2fbe156a8ac3d33ecd481eb34bb2db28.tar.gz
efl_ui_focus_manager_calc: fix unregistering the root of a redirect
There is often a tree of elements registered in a manager that are having all the same redirect element. Unserting the redirect property just because the node has this redirect element is not helpfull as this would break basically elm_tests button search. However, if it is the container itself, then the redirect can be unset, as nothing else can ever reach again the redirect manager. ref https://phab.enlightenment.org/D6800 Differential Revision: https://phab.enlightenment.org/D6802
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c
index 1c17863c59..fb44889662 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -739,18 +739,28 @@ _efl_ui_focus_manager_calc_unregister(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_
F_DBG("Manager: %p unregister %p", obj, child);
- if (eina_list_last_data_get(pd->focus_stack) == node && !pd->redirect)
+ if (eina_list_last_data_get(pd->focus_stack) == node)
{
if (!efl_invalidated_get(pd->root->focusable))
{
- Node *n;
+ Node *n = NULL;
- n = eina_list_nth(pd->focus_stack, eina_list_count(pd->focus_stack) - 2);
- if (!n)
- n = _request_subchild_except(pd->root, node);
+ // if there is no redirect manager, then try to recover the focus property to a different element
+ //allow the removal of the redirect when we are removing the child that is the redirect manager
+ if (!pd->redirect || pd->redirect == child)
+ {
+ n = eina_list_nth(pd->focus_stack, eina_list_count(pd->focus_stack) - 2);
+ if (!n)
+ n = _request_subchild_except(pd->root, node);
- if (n)
- efl_ui_focus_manager_focus_set(obj, n->focusable);
+ if (n)
+ efl_ui_focus_manager_focus_set(obj, n->focusable);
+ }
+ // if there is a redirect manager, then remove the flag from the child
+ if (!n)
+ {
+ efl_ui_focus_object_focus_set(child, EINA_FALSE);
+ }
}
}