summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2018-04-07 17:25:35 +0200
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-04-09 18:05:27 +0200
commit59828721d80ecad0689cc469018318877e158c38 (patch)
tree32f068a3355a549a16b67632f813e26399bae43e
parent39af0ebde0ac7e6c8bdbc59e3796c1e46b6da3fa (diff)
efl_ui_focus_layer: return the registered focus manager when active
this fixes in chain setting for hovers and ctxpopups
-rw-r--r--src/lib/elementary/efl_ui_focus_layer.c26
-rw-r--r--src/lib/elementary/efl_ui_focus_layer.eo1
2 files changed, 26 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_focus_layer.c b/src/lib/elementary/efl_ui_focus_layer.c
index 9df3ed89b9..77b47d19a3 100644
--- a/src/lib/elementary/efl_ui_focus_layer.c
+++ b/src/lib/elementary/efl_ui_focus_layer.c
@@ -61,7 +61,19 @@ _efl_ui_focus_layer_efl_object_destructor(Eo *obj, Efl_Ui_Focus_Layer_Data *pd E
61EOLIAN static Efl_Ui_Focus_Manager* 61EOLIAN static Efl_Ui_Focus_Manager*
62_efl_ui_focus_layer_efl_ui_focus_object_focus_manager_get(Eo *obj, Efl_Ui_Focus_Layer_Data *pd EINA_UNUSED) 62_efl_ui_focus_layer_efl_ui_focus_object_focus_manager_get(Eo *obj, Efl_Ui_Focus_Layer_Data *pd EINA_UNUSED)
63{ 63{
64 return elm_widget_top_get(obj); 64 if (pd->registered_manager)
65 return elm_widget_top_get(obj);
66 else
67 return NULL;
68}
69
70EOLIAN static Efl_Ui_Focus_Object*
71_efl_ui_focus_layer_efl_ui_focus_object_focus_parent_get(Eo *obj, Efl_Ui_Focus_Layer_Data *pd)
72{
73 if (pd->registered_manager)
74 return efl_ui_focus_manager_root_get(pd->registered_manager);
75 else
76 return NULL;
65} 77}
66 78
67EOLIAN static Eina_Bool 79EOLIAN static Eina_Bool
@@ -81,6 +93,13 @@ _efl_ui_focus_layer_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Layer_Data *pd)
81 return obj; 93 return obj;
82} 94}
83 95
96static void
97_publish_state_change(Eo *obj, Efl_Ui_Focus_Manager *omanager, Efl_Ui_Focus_Object *oobj)
98{
99 efl_event_callback_call(obj, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, omanager);
100 efl_event_callback_call(obj, EFL_UI_FOCUS_OBJECT_EVENT_LOGICAL_CHANGED, oobj);
101}
102
84EOLIAN static void 103EOLIAN static void
85_efl_ui_focus_layer_enable_set(Eo *obj, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool v) 104_efl_ui_focus_layer_enable_set(Eo *obj, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool v)
86{ 105{
@@ -89,10 +108,14 @@ _efl_ui_focus_layer_enable_set(Eo *obj, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool v
89 pd->registered_manager = elm_widget_top_get(obj); 108 pd->registered_manager = elm_widget_top_get(obj);
90 109
91 efl_ui_focus_manager_calc_register_logical(pd->registered_manager, obj, efl_ui_focus_manager_root_get(pd->registered_manager), obj); 110 efl_ui_focus_manager_calc_register_logical(pd->registered_manager, obj, efl_ui_focus_manager_root_get(pd->registered_manager), obj);
111 _publish_state_change(obj, NULL, NULL);
92 efl_ui_focus_manager_focus_set(pd->manager, obj); 112 efl_ui_focus_manager_focus_set(pd->manager, obj);
113
93 } 114 }
94 else 115 else
95 { 116 {
117 Eo *omanager = pd->registered_manager, *oobj = efl_ui_focus_manager_root_get(omanager);
118
96 if (!pd->registered_manager) return; 119 if (!pd->registered_manager) return;
97 120
98 if (efl_ui_focus_manager_redirect_get(pd->registered_manager) == obj) 121 if (efl_ui_focus_manager_redirect_get(pd->registered_manager) == obj)
@@ -100,6 +123,7 @@ _efl_ui_focus_layer_enable_set(Eo *obj, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool v
100 123
101 efl_ui_focus_manager_calc_unregister(pd->registered_manager, obj); 124 efl_ui_focus_manager_calc_unregister(pd->registered_manager, obj);
102 pd->registered_manager = NULL; 125 pd->registered_manager = NULL;
126 _publish_state_change(obj, omanager, oobj);
103 } 127 }
104} 128}
105 129
diff --git a/src/lib/elementary/efl_ui_focus_layer.eo b/src/lib/elementary/efl_ui_focus_layer.eo
index cb955fc19e..068490b547 100644
--- a/src/lib/elementary/efl_ui_focus_layer.eo
+++ b/src/lib/elementary/efl_ui_focus_layer.eo
@@ -26,6 +26,7 @@ mixin Efl.Ui.Focus.Layer (Efl.Interface, Efl.Ui.Widget, Efl.Gfx, Efl.Ui.Focus.Ma
26 Efl.Gfx.visible {set;} 26 Efl.Gfx.visible {set;}
27 Efl.Ui.Focus.Manager.move; 27 Efl.Ui.Focus.Manager.move;
28 Efl.Ui.Focus.Object.focus_manager { get; } 28 Efl.Ui.Focus.Object.focus_manager { get; }
29 Efl.Ui.Focus.Object.focus_parent { get; }
29 Efl.Object.constructor; 30 Efl.Object.constructor;
30 Efl.Object.destructor; 31 Efl.Object.destructor;
31 } 32 }