summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-04-07 16:34:29 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-04-07 16:42:51 +0900
commite29102e1344b0f5aa25d189593cdaf9a30ba8fa6 (patch)
treea462f1c774f858ed0f87bf677f0fb28435cc56b1
parent6e0c86eb67c5a95953e0dcedb01ecc6e9cfa391e (diff)
Revert "efl_ui_focus_manager_root_focus: refactor _state_eval"
This reverts commit c6ce04e48f7813475e929f6205a2f6a2e7eb9729. OK. I bisected and found that this is ythe root cause for 2 pretty chunky bugs. Reverting this fixes T6870 and fixes T6871. so that's 2 segvs in existing uses and even olne (elm config) ships with efl. Having a look at the diff doesn't jump out what is wrong here, but the best course IMHO is to take this patch and put it back into review again... :)
-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, 25 insertions, 37 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 3b21fb7729..1a90cf2927 100644
--- a/src/lib/elementary/efl_ui_focus_manager_root_focus.c
+++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
@@ -13,6 +13,7 @@
13 13
14typedef struct { 14typedef struct {
15 Efl_Ui_Focus_Object *root; 15 Efl_Ui_Focus_Object *root;
16 Eina_List *none_logicals;
16 17
17 Evas_Object *rect; 18 Evas_Object *rect;
18 Eina_Bool rect_registered; 19 Eina_Bool rect_registered;
@@ -30,48 +31,30 @@ _trap(Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *obj)
30static void 31static void
31_state_eval(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd) 32_state_eval(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
32{ 33{
33 Efl_Ui_Focus_Object *root; 34 if (pd->none_logicals && pd->rect_registered)
34 Eina_Bool none_logical = EINA_FALSE;
35
36 if (pd->rect_registered)
37 efl_ui_focus_manager_calc_unregister(obj, pd->rect);
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
45 { 35 {
46 efl_ui_focus_manager_calc_register(obj, pd->rect, pd->root, NULL); 36 efl_ui_focus_manager_calc_unregister(obj, pd->rect);
47 pd->rect_registered = EINA_TRUE; 37 pd->rect_registered = EINA_FALSE;
48 } 38 }
49} 39 else if (!pd->none_logicals && !pd->rect_registered)
50
51EOLIAN static Eina_Bool
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)
53{
54 if (efl_ui_focus_manager_calc_register(efl_super(obj, MY_CLASS), child, parent, redirect))
55 { 40 {
56 if (child != pd->rect) 41 efl_ui_focus_manager_calc_register(obj, pd->rect, pd->root, NULL);
57 _state_eval(obj, pd); 42 pd->rect_registered = EINA_TRUE;
58
59 return EINA_TRUE;
60 } 43 }
61 return EINA_FALSE;
62} 44}
63 45
64EOLIAN static Eina_Bool 46EOLIAN 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) 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)
66{ 48{
67 if (efl_ui_focus_manager_calc_register_logical(efl_super(obj, MY_CLASS), child, parent, redirect)) 49 Eina_Bool ret = EINA_FALSE;
50 if (efl_ui_focus_manager_calc_register(efl_super(obj, MY_CLASS), child, parent, redirect))
68 { 51 {
69 if (redirect) 52 pd->none_logicals = eina_list_append(pd->none_logicals, child);
70 _state_eval(obj, pd); 53 ret = EINA_TRUE;
71
72 return EINA_TRUE;
73 } 54 }
74 return EINA_FALSE; 55 if (child != pd->rect)
56 _state_eval(obj, pd);
57 return ret;
75} 58}
76 59
77EOLIAN static void 60EOLIAN static void
@@ -79,6 +62,8 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_unregister(Eo *obj, E
79{ 62{
80 efl_ui_focus_manager_calc_unregister(efl_super(obj, MY_CLASS), child); 63 efl_ui_focus_manager_calc_unregister(efl_super(obj, MY_CLASS), child);
81 64
65 pd->none_logicals = eina_list_remove(pd->none_logicals, child);
66
82 if (child != pd->rect) 67 if (child != pd->rect)
83 _state_eval(obj, pd); 68 _state_eval(obj, pd);
84} 69}
@@ -120,10 +105,14 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_logical_end(Eo *obj, Efl_U
120EOLIAN static Eina_Iterator * 105EOLIAN static Eina_Iterator *
121_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_border_elements_get(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd) 106_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_border_elements_get(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
122{ 107{
123 if (pd->rect_registered) 108 if (!!pd->none_logicals)
124 return eina_list_iterator_new(pd->iterator_list); 109 {
125 110 return efl_ui_focus_manager_border_elements_get(efl_super(obj, MY_CLASS));;
126 return efl_ui_focus_manager_border_elements_get(efl_super(obj, MY_CLASS)); 111 }
112 else
113 {
114 return eina_list_iterator_new(pd->iterator_list);
115 }
127} 116}
128 117
129 118
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 e4062df06d..4c86d3d563 100644
--- a/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
+++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
@@ -1,7 +1,6 @@
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;
5 Efl.Ui.Focus.Manager.Calc.register; 4 Efl.Ui.Focus.Manager.Calc.register;
6 Efl.Ui.Focus.Manager.Calc.unregister; 5 Efl.Ui.Focus.Manager.Calc.unregister;
7 Efl.Ui.Focus.Manager.manager_focus {set; get;} 6 Efl.Ui.Focus.Manager.manager_focus {set; get;}