summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2018-04-09 16:16:16 +0200
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-04-09 18:05:27 +0200
commit84ad5d9fe3a56cdff2455d4d672d473e785a5181 (patch)
tree5c3f467e6d0420625010f1e613be876d4d6f6dee
parent33921385f9eb2f9062d9a28c030d1e0ff418658c (diff)
introduce efl_ui_focus_manager_window_root
Which is a interface that indicates that this is the root of all focus managers.
-rw-r--r--src/Makefile_Elementary.am1
-rw-r--r--src/lib/elementary/Elementary.h1
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.c1
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c18
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_window_root.eo7
-rw-r--r--src/lib/elementary/efl_ui_win.eo2
6 files changed, 21 insertions, 9 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index b3eabe7a6b..02008ee6e1 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -101,6 +101,7 @@ elm_public_eolian_files = \
101 lib/elementary/efl_selection.eo \ 101 lib/elementary/efl_selection.eo \
102 lib/elementary/efl_ui_dnd.eo \ 102 lib/elementary/efl_ui_dnd.eo \
103 lib/elementary/efl_ui_dnd_container.eo \ 103 lib/elementary/efl_ui_dnd_container.eo \
104 lib/elementary/efl_ui_focus_manager_window_root.eo \
104 $(NULL) 105 $(NULL)
105 106
106# More public files -- FIXME 107# More public files -- FIXME
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index fce9c84580..a7161e4a9c 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -155,6 +155,7 @@ typedef Eo Efl_Ui_Focus_Manager;
155 155
156# include <efl_ui_focus_object.eo.h> 156# include <efl_ui_focus_object.eo.h>
157# include <efl_ui_focus_manager.eo.h> 157# include <efl_ui_focus_manager.eo.h>
158# include <efl_ui_focus_manager_window_root.eo.h>
158# include <efl_ui_focus_manager_calc.eo.h> 159# include <efl_ui_focus_manager_calc.eo.h>
159# include <efl_ui_focus_manager_sub.eo.h> 160# include <efl_ui_focus_manager_sub.eo.h>
160# include <efl_ui_focus_manager_root_focus.eo.h> 161# include <efl_ui_focus_manager_root_focus.eo.h>
diff --git a/src/lib/elementary/efl_ui_focus_manager.c b/src/lib/elementary/efl_ui_focus_manager.c
index 09db7da090..2cb14a6790 100644
--- a/src/lib/elementary/efl_ui_focus_manager.c
+++ b/src/lib/elementary/efl_ui_focus_manager.c
@@ -6,3 +6,4 @@
6#include "elm_priv.h" 6#include "elm_priv.h"
7 7
8#include "efl_ui_focus_manager.eo.c" 8#include "efl_ui_focus_manager.eo.c"
9#include "efl_ui_focus_manager_window_root.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c
index 868db07d99..f6357c3343 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -86,22 +86,24 @@ static void dirty_add(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *dirty);
86static void 86static void
87_manager_in_chain_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd) 87_manager_in_chain_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
88{ 88{
89 Eo *manager; 89 Eo *manager, *root;
90 90
91 EINA_SAFETY_ON_NULL_RETURN(pd->root); 91 root = efl_ui_focus_manager_root_get(obj);
92 manager = efl_ui_focus_object_focus_manager_get(pd->root->focusable);
93
94 EINA_SAFETY_ON_NULL_RETURN(root);
92 95
93 if (!efl_isa(pd->root->focusable, EFL_UI_WIN_CLASS)) 96 if (!efl_isa(root, EFL_UI_FOCUS_MANAGER_WINDOW_ROOT_INTERFACE))
94 EINA_SAFETY_ON_NULL_RETURN(efl_ui_focus_object_focus_manager_get(pd->root->focusable)); 97 EINA_SAFETY_ON_NULL_RETURN(manager);
95 98
96 //so we dont run infinitly this does not fix it, but at least we only have a error 99 //so we dont run infinitly this does not fix it, but at least we only have a error
97 EINA_SAFETY_ON_TRUE_RETURN(efl_ui_focus_object_focus_manager_get(pd->root->focusable) == obj); 100 EINA_SAFETY_ON_TRUE_RETURN(manager == obj);
98 101
99 manager = efl_ui_focus_object_focus_manager_get(pd->root->focusable);
100 if (manager) 102 if (manager)
101 efl_ui_focus_manager_focus_set(manager, pd->root->focusable); 103 efl_ui_focus_manager_focus_set(manager, root);
102 else 104 else
103 DBG("No focus manager for focusable %s@%p", 105 DBG("No focus manager for focusable %s@%p",
104 efl_class_name_get(pd->root->focusable), pd->root->focusable); 106 efl_class_name_get(pd->root->focusable), root);
105} 107}
106 108
107static Efl_Ui_Focus_Direction 109static Efl_Ui_Focus_Direction
diff --git a/src/lib/elementary/efl_ui_focus_manager_window_root.eo b/src/lib/elementary/efl_ui_focus_manager_window_root.eo
new file mode 100644
index 0000000000..6f49700ec6
--- /dev/null
+++ b/src/lib/elementary/efl_ui_focus_manager_window_root.eo
@@ -0,0 +1,7 @@
1interface Efl.Ui.Focus.Manager.Window_Root {
2 [[ A interface to indicate the end of a focus chain.
3
4 Focusmanagers are ensuring that if they give focus to something, that they are registered in the upper focus manager.
5 The most upper focus manager does not need to do that, and can implement this interface to indicate that.
6 ]]
7}
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index 18c634ffc3..0101b54b82 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -158,7 +158,7 @@ class Efl.Ui.Win (Efl.Ui.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Wind
158 Efl.Access.Component, Efl.Access.Widget.Action, 158 Efl.Access.Component, Efl.Access.Widget.Action,
159 Efl.Content, Efl.Input.State, Efl.Input.Interface, Efl.Screen, 159 Efl.Content, Efl.Input.State, Efl.Input.Interface, Efl.Screen,
160 Efl.Gfx.Size.Hint, Efl.Text, Efl.Config.Global, Efl.Part, 160 Efl.Gfx.Size.Hint, Efl.Text, Efl.Config.Global, Efl.Part,
161 Efl.Ui.Focus.Manager ) 161 Efl.Ui.Focus.Manager, Efl.Ui.Focus.Manager.Window_Root)
162{ 162{
163 [[Efl UI window class]] 163 [[Efl UI window class]]
164 legacy_prefix: elm_win; 164 legacy_prefix: elm_win;