summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2017-10-17 19:42:32 +0200
committerMarcel Hollerbach <marcel@osg.samsung.com>2017-10-19 10:04:59 +0200
commit6956dfc7a6a0f85ff485d2e18c5c3439ad461f37 (patch)
treeffac65d838521b43344b0c732503b507338170d0
parentd701597eb9b164bb7cd55fc4ca38175f91ccf72a (diff)
efl_ui_focus_manager_calc: put every element on the focus stack
move the addition to the focus stack to the general path. This means every element is now on the focus stack.
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c
index 3312aebd2d..7cc75a643a 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -224,6 +224,24 @@ _focus_stack_unfocus_last(Efl_Ui_Focus_Manager_Calc_Data *pd)
224 efl_ui_focus_object_focus_set(n->focusable, EINA_FALSE); 224 efl_ui_focus_object_focus_set(n->focusable, EINA_FALSE);
225} 225}
226 226
227static Node*
228_focus_stack_last_regular(Efl_Ui_Focus_Manager_Calc_Data *pd)
229{
230 Eina_List *l;
231 Node *upper;
232
233 l = eina_list_last(pd->focus_stack);
234 upper = eina_list_last_data_get(pd->focus_stack);
235
236 while (upper && upper->type != NODE_TYPE_NORMAL)
237 {
238 l = eina_list_prev(l);
239 upper = eina_list_data_get(l);
240 }
241
242 return upper;
243}
244
227//CALCULATING STUFF 245//CALCULATING STUFF
228 246
229static inline int 247static inline int
@@ -1022,6 +1040,9 @@ _coords_movement(Efl_Ui_Focus_Manager_Calc_Data *pd, Node *upper, Efl_Ui_Focus_D
1022 //we are searching which of the partners is lower to the history 1040 //we are searching which of the partners is lower to the history
1023 EINA_LIST_REVERSE_FOREACH(pd->focus_stack, node_list, candidate) 1041 EINA_LIST_REVERSE_FOREACH(pd->focus_stack, node_list, candidate)
1024 { 1042 {
1043 //we only calculate partners for normal nodes
1044 if (candidate->type == NODE_TYPE_NORMAL) continue;
1045
1025 if (eina_list_data_find(DIRECTION_ACCESS(upper, direction).partners, candidate)) 1046 if (eina_list_data_find(DIRECTION_ACCESS(upper, direction).partners, candidate))
1026 { 1047 {
1027 //this is the next accessable part 1048 //this is the next accessable part
@@ -1200,7 +1221,7 @@ _request_move(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Fo
1200 Node *dir = NULL; 1221 Node *dir = NULL;
1201 1222
1202 if (!upper) 1223 if (!upper)
1203 upper = eina_list_last_data_get(pd->focus_stack); 1224 upper = _focus_stack_last_regular(pd);
1204 1225
1205 if (!upper) 1226 if (!upper)
1206 { 1227 {
@@ -1330,9 +1351,6 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_
1330 1351
1331 _focus_stack_unfocus_last(pd); 1352 _focus_stack_unfocus_last(pd);
1332 1353
1333 //remove the object from the list and add it again
1334 pd->focus_stack = eina_list_remove(pd->focus_stack, node);
1335 pd->focus_stack = eina_list_append(pd->focus_stack, node);
1336 1354
1337 //save fields we later need 1355 //save fields we later need
1338 node_focusable = node->focusable; 1356 node_focusable = node->focusable;
@@ -1340,9 +1358,15 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_
1340 //populate the new change 1358 //populate the new change
1341 efl_ui_focus_object_focus_set(node->focusable, EINA_TRUE); 1359 efl_ui_focus_object_focus_set(node->focusable, EINA_TRUE);
1342 efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, node_focusable); 1360 efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, node_focusable);
1343 node = NULL;
1344 } 1361 }
1345 1362
1363 //remove the object from the list and add it again
1364 pd->focus_stack = eina_list_remove(pd->focus_stack, node);
1365 pd->focus_stack = eina_list_append(pd->focus_stack, node);
1366
1367 //set to NULL here, from the event earlier this pointer could be dead.
1368 node = NULL;
1369
1346 //now check if this is also a listener object 1370 //now check if this is also a listener object
1347 if (redirect_manager) 1371 if (redirect_manager)
1348 { 1372 {