summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2017-10-17 19:30:15 +0200
committerMarcel Hollerbach <marcel@osg.samsung.com>2017-10-19 10:04:59 +0200
commit0220418b84bf171403e6a98501f91217be39d401 (patch)
tree7dab5d874c0847221fb94fa7cac2b78917d32efe
parent0a13e15c7d98a8dd41d1270c6acdeb3a0692f33d (diff)
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.
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c14
1 files changed, 7 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 88cdcf764c..6921de5d8d 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_
1246 Efl_Ui_Focus_Manager *redirect_manager; 1246 Efl_Ui_Focus_Manager *redirect_manager;
1247 Eo *focusable; 1247 Eo *focusable;
1248 Node_Type type; 1248 Node_Type type;
1249 Eina_Bool was_redirect = EINA_FALSE;
1250 1249
1251 EINA_SAFETY_ON_NULL_RETURN(focus); 1250 EINA_SAFETY_ON_NULL_RETURN(focus);
1252 1251
@@ -1291,6 +1290,13 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_
1291 } 1290 }
1292 } 1291 }
1293 1292
1293 if (eina_list_last_data_get(pd->focus_stack) == node)
1294 {
1295 //the correct one is focused
1296 if (node->redirect_manager == pd->redirect)
1297 return;
1298 }
1299
1294 if (pd->redirect) 1300 if (pd->redirect)
1295 { 1301 {
1296 //reset the history of that manager 1302 //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_
1298 1304
1299 //first unset the redirect 1305 //first unset the redirect
1300 efl_ui_focus_manager_redirect_set(obj, NULL); 1306 efl_ui_focus_manager_redirect_set(obj, NULL);
1301
1302 //we have been redirecting
1303 was_redirect = EINA_TRUE;
1304 } 1307 }
1305 1308
1306 redirect_manager = node->redirect_manager; 1309 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_
1313 //check if this is already the focused object 1316 //check if this is already the focused object
1314 old_focus = eina_list_last_data_get(pd->focus_stack); 1317 old_focus = eina_list_last_data_get(pd->focus_stack);
1315 1318
1316 //check if this is already at the top
1317 if (!was_redirect && old_focus && old_focus->focusable == focus) return;
1318
1319 //remove the object from the list and add it again 1319 //remove the object from the list and add it again
1320 pd->focus_stack = eina_list_remove(pd->focus_stack, node); 1320 pd->focus_stack = eina_list_remove(pd->focus_stack, node);
1321 pd->focus_stack = eina_list_append(pd->focus_stack, node); 1321 pd->focus_stack = eina_list_append(pd->focus_stack, node);