diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2018-08-09 10:52:55 +0200 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2018-08-14 15:00:58 +0200 |
commit | 37308192d908507a03712bd36974b4b2dec9ae6d (patch) | |
tree | 94408954d625ffb1660ad238a8533e5651b34a2c | |
parent | f21cf89a2fbe156a8ac3d33ecd481eb34bb2db28 (diff) | |
download | efl-37308192d908507a03712bd36974b4b2dec9ae6d.tar.gz |
efl_ui_focus_manager_calc: restore focus correctly if redirect gets NULL
Otherwise we might end up with focus beeing NULL.
Differential Revision: https://phab.enlightenment.org/D6803
-rw-r--r-- | src/lib/elementary/efl_ui_focus_manager_calc.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c index fb44889662..b36b2053e9 100644 --- a/src/lib/elementary/efl_ui_focus_manager_calc.c +++ b/src/lib/elementary/efl_ui_focus_manager_calc.c @@ -800,11 +800,22 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_redirect_set(Eo *obj, Efl_Ui_Foc n = eina_list_last_data_get(pd->focus_stack); - if (n) + if (!pd->redirect && old_manager) { - if (!pd->redirect && old_manager) - efl_ui_focus_object_focus_set(n->focusable, EINA_TRUE); - else if (pd->redirect && !old_manager) + if (n) + { + efl_ui_focus_object_focus_set(n->focusable, EINA_TRUE); + } + else + { + n = _request_subchild(pd->root); + if (n) + efl_ui_focus_manager_focus_set(obj, n->focusable); + } + } + else if (pd->redirect && !old_manager) + { + if (n) efl_ui_focus_object_focus_set(n->focusable, EINA_FALSE); } } |