/// <since_tizen> preview </since_tizen>
public void SetFocus(bool isFocus)
{
- Interop.Elementary.elm_object_focus_set(RealHandle, isFocus);
-
- // Temporary code due to focus issue (will be removed at Tizen 5.0)
- if (this is Window)
- {
- if (isFocus && !Interop.Evas.evas_object_focus_get(RealHandle))
- Interop.Evas.evas_object_focus_set(RealHandle, true);
- }
+ if (isFocus)
+ Interop.Elementary.elm_object_focus_set(RealHandle, isFocus);
+ else
+ // Temporary code due to focus issue (will be removed at Tizen 5.0)
+ Interop.Elementary.elm_object_focused_clear(RealHandle);
}
/// <summary>
return Marshal.PtrToStringAnsi(_elm_config_profile_get());
}
+ internal static void elm_object_focused_clear(IntPtr handle)
+ {
+ if (elm_widget_is(handle))
+ {
+ elm_widget_focused_object_clear(handle);
+ }
+ else
+ {
+ Evas.evas_object_focus_set(handle, false);
+ }
+
+ IntPtr win = elm_widget_top_get(handle);
+ if (win != IntPtr.Zero && Eo.eo_class_name_get(Eo.eo_class_get(win)) == "Elm_Win")
+ {
+ Evas.evas_object_focus_set(win, true);
+ }
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_widget_top_get(IntPtr handle);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_widget_is(IntPtr handle);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_widget_focused_object_clear(IntPtr handle);
+
[DllImport(Libraries.Elementary)]
internal static extern void elm_config_preferred_engine_set(string name);