summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2018-04-09 18:27:09 +0200
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-04-09 18:27:09 +0200
commite70bf4e2311885d1302ce13254938d9ee3a2a494 (patch)
treed5ea058d4a0cddef6f4e6bf88565db5d0a62b22b
parent84ad5d9fe3a56cdff2455d4d672d473e785a5181 (diff)
efl_ui_focus_manager_root_focus: refactor _state_eval
Summary: we have to check whether all of descendant are none_logical. this fixes T6800 Test Plan: 1. elementary_test -to ctxpopup 2. Click 'Ctxpopup with user content' 3. Try focus ctxpopup content(button) using arrow key. 4. Check that the content is focused (you can move scroll bar) Reviewers: bu5hm4n Subscribers: raster, cedric Maniphest Tasks: T6800 Differential Revision: https://phab.enlightenment.org/D5856
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_root_focus.c61
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_root_focus.eo1
2 files changed, 37 insertions, 25 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager_root_focus.c b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
index 1a90cf2927..3b21fb7729 100644
--- a/src/lib/elementary/efl_ui_focus_manager_root_focus.c
+++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
@@ -13,7 +13,6 @@
13 13
14typedef struct { 14typedef struct {
15 Efl_Ui_Focus_Object *root; 15 Efl_Ui_Focus_Object *root;
16 Eina_List *none_logicals;
17 16
18 Evas_Object *rect; 17 Evas_Object *rect;
19 Eina_Bool rect_registered; 18 Eina_Bool rect_registered;
@@ -31,30 +30,48 @@ _trap(Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *obj)
31static void 30static void
32_state_eval(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd) 31_state_eval(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
33{ 32{
34 if (pd->none_logicals && pd->rect_registered) 33 Efl_Ui_Focus_Object *root;
35 { 34 Eina_Bool none_logical = EINA_FALSE;
36 efl_ui_focus_manager_calc_unregister(obj, pd->rect); 35
37 pd->rect_registered = EINA_FALSE; 36 if (pd->rect_registered)
38 } 37 efl_ui_focus_manager_calc_unregister(obj, pd->rect);
39 else if (!pd->none_logicals && !pd->rect_registered) 38
39 root = efl_ui_focus_manager_root_get(obj);
40 none_logical = !!efl_ui_focus_manager_request_subchild(obj, root);
41
42 if (none_logical)
43 pd->rect_registered = EINA_FALSE;
44 else
40 { 45 {
41 efl_ui_focus_manager_calc_register(obj, pd->rect, pd->root, NULL); 46 efl_ui_focus_manager_calc_register(obj, pd->rect, pd->root, NULL);
42 pd->rect_registered = EINA_TRUE; 47 pd->rect_registered = EINA_TRUE;
43 } 48 }
44} 49}
45 50
46EOLIAN static Eina_Bool 51EOLIAN static Eina_Bool
47_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_register(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *child, Efl_Ui_Focus_Object *parent, Efl_Ui_Focus_Manager *redirect) 52_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_register(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *child, Efl_Ui_Focus_Object *parent, Efl_Ui_Focus_Manager *redirect)
48{ 53{
49 Eina_Bool ret = EINA_FALSE;
50 if (efl_ui_focus_manager_calc_register(efl_super(obj, MY_CLASS), child, parent, redirect)) 54 if (efl_ui_focus_manager_calc_register(efl_super(obj, MY_CLASS), child, parent, redirect))
51 { 55 {
52 pd->none_logicals = eina_list_append(pd->none_logicals, child); 56 if (child != pd->rect)
53 ret = EINA_TRUE; 57 _state_eval(obj, pd);
58
59 return EINA_TRUE;
54 } 60 }
55 if (child != pd->rect) 61 return EINA_FALSE;
56 _state_eval(obj, pd); 62}
57 return ret; 63
64EOLIAN static Eina_Bool
65_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_register_logical(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *child, Efl_Ui_Focus_Object *parent, Efl_Ui_Focus_Manager *redirect)
66{
67 if (efl_ui_focus_manager_calc_register_logical(efl_super(obj, MY_CLASS), child, parent, redirect))
68 {
69 if (redirect)
70 _state_eval(obj, pd);
71
72 return EINA_TRUE;
73 }
74 return EINA_FALSE;
58} 75}
59 76
60EOLIAN static void 77EOLIAN static void
@@ -62,8 +79,6 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_unregister(Eo *obj, E
62{ 79{
63 efl_ui_focus_manager_calc_unregister(efl_super(obj, MY_CLASS), child); 80 efl_ui_focus_manager_calc_unregister(efl_super(obj, MY_CLASS), child);
64 81
65 pd->none_logicals = eina_list_remove(pd->none_logicals, child);
66
67 if (child != pd->rect) 82 if (child != pd->rect)
68 _state_eval(obj, pd); 83 _state_eval(obj, pd);
69} 84}
@@ -105,14 +120,10 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_logical_end(Eo *obj, Efl_U
105EOLIAN static Eina_Iterator * 120EOLIAN static Eina_Iterator *
106_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_border_elements_get(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd) 121_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_border_elements_get(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
107{ 122{
108 if (!!pd->none_logicals) 123 if (pd->rect_registered)
109 { 124 return eina_list_iterator_new(pd->iterator_list);
110 return efl_ui_focus_manager_border_elements_get(efl_super(obj, MY_CLASS));; 125
111 } 126 return efl_ui_focus_manager_border_elements_get(efl_super(obj, MY_CLASS));
112 else
113 {
114 return eina_list_iterator_new(pd->iterator_list);
115 }
116} 127}
117 128
118 129
diff --git a/src/lib/elementary/efl_ui_focus_manager_root_focus.eo b/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
index 4c86d3d563..e4062df06d 100644
--- a/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
+++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
@@ -1,6 +1,7 @@
1class Efl.Ui.Focus.Manager.Root_Focus(Efl.Ui.Focus.Manager.Calc) { 1class Efl.Ui.Focus.Manager.Root_Focus(Efl.Ui.Focus.Manager.Calc) {
2 [[ This class ensures that the root is at least focusable, if nothing else is focusable]] 2 [[ This class ensures that the root is at least focusable, if nothing else is focusable]]
3 implements { 3 implements {
4 Efl.Ui.Focus.Manager.Calc.register_logical;
4 Efl.Ui.Focus.Manager.Calc.register; 5 Efl.Ui.Focus.Manager.Calc.register;
5 Efl.Ui.Focus.Manager.Calc.unregister; 6 Efl.Ui.Focus.Manager.Calc.unregister;
6 Efl.Ui.Focus.Manager.manager_focus {set; get;} 7 Efl.Ui.Focus.Manager.manager_focus {set; get;}