forked from enlightenment/efl
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 D6800 Differential Revision: https://phab.enlightenment.org/D6802
This commit is contained in:
parent
92bb03d7f5
commit
f21cf89a2f
|
@ -739,12 +739,16 @@ _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;
|
||||
|
||||
// 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);
|
||||
|
@ -752,6 +756,12 @@ _efl_ui_focus_manager_calc_unregister(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
eina_hash_del_by_key(pd->node_hash, &child);
|
||||
|
|
Loading…
Reference in New Issue