bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=84ad5d9fe3a56cdff2455d4d672d473e785a5181

commit 84ad5d9fe3a56cdff2455d4d672d473e785a5181
Author: Marcel Hollerbach <mar...@osg.samsung.com>
Date:   Mon Apr 9 16:16:16 2018 +0200

    introduce efl_ui_focus_manager_window_root
    
    Which is a interface that indicates that this is the root of all focus
    managers.
---
 src/Makefile_Elementary.am                             |  1 +
 src/lib/elementary/Elementary.h                        |  1 +
 src/lib/elementary/efl_ui_focus_manager.c              |  1 +
 src/lib/elementary/efl_ui_focus_manager_calc.c         | 18 ++++++++++--------
 src/lib/elementary/efl_ui_focus_manager_window_root.eo |  7 +++++++
 src/lib/elementary/efl_ui_win.eo                       |  2 +-
 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 = \
        lib/elementary/efl_selection.eo \
        lib/elementary/efl_ui_dnd.eo \
        lib/elementary/efl_ui_dnd_container.eo \
+       lib/elementary/efl_ui_focus_manager_window_root.eo \
        $(NULL)
 
 # 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;
 
 # include <efl_ui_focus_object.eo.h>
 # include <efl_ui_focus_manager.eo.h>
+# include <efl_ui_focus_manager_window_root.eo.h>
 # include <efl_ui_focus_manager_calc.eo.h>
 # include <efl_ui_focus_manager_sub.eo.h>
 # 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 @@
 #include "elm_priv.h"
 
 #include "efl_ui_focus_manager.eo.c"
+#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);
 static void
 _manager_in_chain_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
 {
-   Eo *manager;
+   Eo *manager, *root;
 
-   EINA_SAFETY_ON_NULL_RETURN(pd->root);
+   root = efl_ui_focus_manager_root_get(obj);
+   manager = efl_ui_focus_object_focus_manager_get(pd->root->focusable);
+
+   EINA_SAFETY_ON_NULL_RETURN(root);
 
-   if (!efl_isa(pd->root->focusable, EFL_UI_WIN_CLASS))
-     
EINA_SAFETY_ON_NULL_RETURN(efl_ui_focus_object_focus_manager_get(pd->root->focusable));
+   if (!efl_isa(root, EFL_UI_FOCUS_MANAGER_WINDOW_ROOT_INTERFACE))
+     EINA_SAFETY_ON_NULL_RETURN(manager);
 
    //so we dont run infinitly this does not fix it, but at least we only have 
a error
-   
EINA_SAFETY_ON_TRUE_RETURN(efl_ui_focus_object_focus_manager_get(pd->root->focusable)
 == obj);
+   EINA_SAFETY_ON_TRUE_RETURN(manager == obj);
 
-   manager = efl_ui_focus_object_focus_manager_get(pd->root->focusable);
    if (manager)
-     efl_ui_focus_manager_focus_set(manager, pd->root->focusable);
+     efl_ui_focus_manager_focus_set(manager, root);
    else
       DBG("No focus manager for focusable %s@%p",
-          efl_class_name_get(pd->root->focusable), pd->root->focusable);
+          efl_class_name_get(pd->root->focusable), root);
 }
 
 static 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 @@
+interface Efl.Ui.Focus.Manager.Window_Root {
+  [[ A interface to indicate the end of a focus chain.
+
+     Focusmanagers are ensuring that if they give focus to something, that 
they are registered in the upper focus manager.
+     The most upper focus manager does not need to do that, and can implement 
this interface to indicate that.
+  ]]
+}
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
                   Efl.Access.Component, Efl.Access.Widget.Action,
                   Efl.Content, Efl.Input.State, Efl.Input.Interface, 
Efl.Screen,
                   Efl.Gfx.Size.Hint, Efl.Text, Efl.Config.Global, Efl.Part,
-                  Efl.Ui.Focus.Manager )
+                  Efl.Ui.Focus.Manager, Efl.Ui.Focus.Manager.Window_Root)
 {
    [[Efl UI window class]]
    legacy_prefix: elm_win;

-- 


Reply via email to