diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index ce5986c645..670139d61d 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -1701,9 +1701,8 @@ _efl_ui_win_elm_widget_focus_direction(Eo *obj, Efl_Ui_Win_Data *_pd EINA_UNUSED EOLIAN static Eina_Bool _efl_ui_win_elm_widget_on_focus(Eo *obj, Efl_Ui_Win_Data *sd, Elm_Object_Item *item EINA_UNUSED) { - Eina_Bool int_ret = EINA_FALSE; - int_ret = elm_obj_widget_on_focus(efl_super(obj, MY_CLASS), NULL); - if (!int_ret) return EINA_TRUE; + if (!elm_obj_widget_on_focus(efl_super(obj, MY_CLASS), NULL)) + return EINA_TRUE; if (sd->img_obj) evas_object_focus_set(sd->img_obj, elm_widget_focus_get(obj)); @@ -6177,8 +6176,9 @@ _efl_ui_win_indicator_type_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNU } EOLIAN static Eina_Bool -_efl_ui_win_focus_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_elm_widget_focus_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) { + // Bypass widget implementation here. return ecore_evas_focus_get(sd->ee); } @@ -8157,6 +8157,12 @@ elm_win_socket_listen(Efl_Ui_Win *obj, const char *svcname, int svcnum, Eina_Boo return efl_ui_win_socket_listen(obj, svcname, svcnum, svcsys); } +EAPI Eina_Bool +elm_win_focus_get(const Efl_Ui_Win *obj) +{ + return elm_obj_widget_focus_get(obj); +} + // deprecated EAPI void diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index f0dd119a61..15c5a275b0 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -339,12 +339,6 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window, skip: bool; [[The skip flag state ($true if it is to be skipped).]] } } - @property focus { - get { - [[Get whether a window has focus.]] - return: bool; [[$true if window has focus, $false otherwise]] - } - } @property autodel { set { [[Set the window's autodel state. @@ -905,6 +899,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window, Elm.Widget.focus_direction_manager_is; Elm.Widget.focus_next; Elm.Widget.theme_apply; + Elm.Widget.focus { get; } Elm.Widget.on_focus; Elm.Widget.widget_event; Elm.Widget.focus_manager_factory; diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h index 591c5164d9..f2399c5662 100644 --- a/src/lib/elementary/elm_win_legacy.h +++ b/src/lib/elementary/elm_win_legacy.h @@ -1148,3 +1148,12 @@ EAPI Evas_Object *elm_win_get(Evas_Object *obj); * @ingroup Efl_Ui_Win */ EAPI Eina_Bool elm_win_socket_listen(Efl_Ui_Win *obj, const char *svcname, int svcnum, Eina_Bool svcsys); + +/** + * @brief Get whether a window has focus. + * + * @return @c true if window has focus, @c false otherwise + * + * @ingroup Efl_Ui_Win + */ +EAPI Eina_Bool elm_win_focus_get(const Efl_Ui_Win *obj);