From: Marcel Hollerbach Date: Tue, 17 Oct 2017 17:30:15 +0000 (+0200) Subject: efl_ui_focus_manager_calc: check if we are already focused earlier X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~2149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0220418b84bf171403e6a98501f91217be39d401;p=platform%2Fupstream%2Fefl.git efl_ui_focus_manager_calc: check if we are already focused earlier if we dont do that we may unset a redirect just to set the same redirect again. --- diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c index 88cdcf7..6921de5 100644 --- a/src/lib/elementary/efl_ui_focus_manager_calc.c +++ b/src/lib/elementary/efl_ui_focus_manager_calc.c @@ -1246,7 +1246,6 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_ Efl_Ui_Focus_Manager *redirect_manager; Eo *focusable; Node_Type type; - Eina_Bool was_redirect = EINA_FALSE; EINA_SAFETY_ON_NULL_RETURN(focus); @@ -1291,6 +1290,13 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_ } } + if (eina_list_last_data_get(pd->focus_stack) == node) + { + //the correct one is focused + if (node->redirect_manager == pd->redirect) + return; + } + if (pd->redirect) { //reset the history of that manager @@ -1298,9 +1304,6 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_ //first unset the redirect efl_ui_focus_manager_redirect_set(obj, NULL); - - //we have been redirecting - was_redirect = EINA_TRUE; } redirect_manager = node->redirect_manager; @@ -1313,9 +1316,6 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_ //check if this is already the focused object old_focus = eina_list_last_data_get(pd->focus_stack); - //check if this is already at the top - if (!was_redirect && old_focus && old_focus->focusable == focus) return; - //remove the object from the list and add it again pd->focus_stack = eina_list_remove(pd->focus_stack, node); pd->focus_stack = eina_list_append(pd->focus_stack, node);