summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_widget.c
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman.samsung@gmail.com>2018-11-20 13:57:12 -0600
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-22 16:09:39 +0100
commit02840efec23203dfd685bdd7b282615d177fd584 (patch)
tree55a64547d7be119990bf9304235daa7ab550c973 /src/lib/elementary/efl_ui_widget.c
parent45f24b6ef4909c2d1142b22435cbecd4da96fd3d (diff)
elm: roll _tree_custom_chain_missing into main focus test function
Further reduction in eo overhead. Differential Revision: https://phab.enlightenment.org/D7315 Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_widget.c50
1 files changed, 20 insertions, 30 deletions
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index 8d2bdade73..498296ee47 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -338,43 +338,34 @@ _efl_ui_widget_focus_highlight_style_get(const Eo *obj, Elm_Widget_Smart_Data *s
338} 338}
339 339
340static Eina_Bool 340static Eina_Bool
341_tree_custom_chain_missing(Eo *obj)
342{
343 Efl_Ui_Widget *wid = obj;
344
345 while (elm_widget_parent_get(wid))
346 {
347 Efl_Ui_Widget *parent = elm_widget_parent_get(wid);
348 ELM_WIDGET_DATA_GET(parent, parent_pd);
349 Eina_List *lst = parent_pd->legacy_focus.custom_chain;
350
351 if (lst)
352 {
353 if (!eina_list_data_find(lst, wid))
354 {
355 WRN("Widget %p disabled due to custom chain of %p", wid, parent);
356 return EINA_TRUE;
357 }
358 }
359
360 wid = parent;
361 }
362
363 return EINA_FALSE;
364}
365
366static Eina_Bool
367_candidacy_exam(Eo *obj) 341_candidacy_exam(Eo *obj)
368{ 342{
343 Eina_List *lst;
369 Efl_Ui_Widget *wid = obj, *top; 344 Efl_Ui_Widget *wid = obj, *top;
345 Elm_Widget_Smart_Data *wid_pd;
370 346
347 wid_pd = efl_data_scope_get(wid, MY_CLASS);
371 do { 348 do {
372 ELM_WIDGET_DATA_GET(wid, wid_pd);
373 349
374 if (wid_pd->disabled) return EINA_TRUE; 350 if (wid_pd->disabled) return EINA_TRUE;
375 if (wid_pd->tree_unfocusable) return EINA_TRUE; 351 if (wid_pd->tree_unfocusable) return EINA_TRUE;
376 top = wid; 352 top = wid;
377 } while((wid = elm_widget_parent_get(wid))); 353
354 wid = elm_widget_parent_get(wid);
355 if (!wid) break;
356 wid_pd = efl_data_scope_get(wid, MY_CLASS);
357
358 lst = wid_pd->legacy_focus.custom_chain;
359 if (lst)
360 {
361 if (!eina_list_data_find(lst, top))
362 {
363 WRN("Widget %p disabled due to custom chain of %p", top, wid);
364 return EINA_TRUE;
365 }
366 }
367
368 } while (1);
378 369
379 return !efl_isa(top, EFL_UI_WIN_CLASS); 370 return !efl_isa(top, EFL_UI_WIN_CLASS);
380} 371}
@@ -486,8 +477,7 @@ _eval_registration_candidate(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool *shou
486 //can focus can be overridden by the following properties 477 //can focus can be overridden by the following properties
487 if ((!pd->parent_obj) || 478 if ((!pd->parent_obj) ||
488 (!evas_object_visible_get(obj)) || 479 (!evas_object_visible_get(obj)) ||
489 (_candidacy_exam(obj)) || 480 (_candidacy_exam(obj)))
490 (_tree_custom_chain_missing(obj)))
491 return; 481 return;
492 482
493 if (pd->can_focus) 483 if (pd->can_focus)