efl_ui_win: make it a focus manager
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>
Fri, 4 Nov 2016 16:44:37 +0000 (17:44 +0100)
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>
Thu, 20 Apr 2017 12:38:57 +0000 (14:38 +0200)
Added a focusmanager with the window itself as the root.

src/lib/elementary/efl_ui_win.c
src/lib/elementary/efl_ui_win.eo

index c1d3f07..2bd0b93 100644 (file)
@@ -164,6 +164,8 @@ struct _Efl_Ui_Win_Data
 
    Evas_Object *main_menu;
 
+   Efl_Ui_Focus_Manager *manager;
+
    struct
    {
       const char  *name;
@@ -5214,11 +5216,16 @@ _efl_ui_win_efl_object_finalize(Eo *obj, Efl_Ui_Win_Data *_pd)
 }
 
 EOLIAN static Eo *
-_efl_ui_win_efl_object_constructor(Eo *obj, Efl_Ui_Win_Data *_pd EINA_UNUSED)
+_efl_ui_win_efl_object_constructor(Eo *obj, Efl_Ui_Win_Data *pd)
 {
    /* Do nothing. */
    /* XXX: We are calling the constructor chain from the finalizer. It's
     * really bad and hacky. Needs fixing. */
+   pd->manager = efl_add(EFL_UI_FOCUS_MANAGER_CLASS, NULL,
+    efl_ui_focus_manager_root_set(efl_added, obj)
+   );
+
+   efl_composite_attach(obj, pd->manager);
 
    return obj;
 }
index 90147dc..2e743af 100644 (file)
@@ -97,7 +97,7 @@ enum Efl.Ui.Win.Indicator_Type
    legacy: efl_ui_win_indicator;
 
    type_unknown, [[Unknown indicator type]]
-   bg_opaque, [[The icon of indicator is opaque, the background of indicator is also opaque. 
+   bg_opaque, [[The icon of indicator is opaque, the background of indicator is also opaque.
                 The content of window is located the end of indicator.
                 The area of indicator and window content are not overlapped]]
    bg_transparent, [[The icon of indicator is opaque, but the background is transparent.
@@ -178,7 +178,7 @@ enum Efl.Ui.Win.Move_Resize_Mode
 class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
                Elm.Interface.Atspi_Component, Elm.Interface.Atspi_Widget_Action,
                Efl.Container, Efl.Input.State, Efl.Input.Interface, Efl.Screen,
-               Efl.Gfx.Size.Hint, Efl.Text, Efl.Config.Global, Efl.Part)
+               Efl.Gfx.Size.Hint, Efl.Text, Efl.Config.Global, Efl.Part, Efl.Ui.Focus.Manager )
 {
    [[Efl UI window class]]
    legacy_prefix: elm_win;
@@ -871,7 +871,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
       }
       move_resize_start {
          [[Start moving or resizing the window.
-           
+
            The user can request the display server to start moving or resizing
            the window by combining modes from @Efl.Ui.Win.Move_Resize_Mode.
            This API can only be called if none of the following conditions is
@@ -886,7 +886,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
            1. Pointer (mouse or touch) down event,
            2. @.move_resize_start called only once with a supported mode,
            3. Pointer (mouse or touch) up event.
-   
+
            If a pointer up event occurs after calling the function, it
            automatically ends the window move and resize operation.