summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-31 15:15:58 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-01 10:09:37 +0900
commit89492d859ba6c94df28ad0549b754ee0b005c82a (patch)
tree9267601165e60408774bc9048932535ba2989db2
parent4b74ca477d261d89e798f75612d848e14168d8f6 (diff)
downloadefl-89492d859ba6c94df28ad0549b754ee0b005c82a.tar.gz
win: Merge focus with elm_widget's (EO)
I believe this should work fine! Ref T5363 Ref T5322
-rw-r--r--src/lib/elementary/efl_ui_win.c14
-rw-r--r--src/lib/elementary/efl_ui_win.eo7
-rw-r--r--src/lib/elementary/elm_win_legacy.h9
3 files changed, 20 insertions, 10 deletions
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);