From d553a5a836d73927569d3449aeaa5e33f82663b6 Mon Sep 17 00:00:00 2001 From: WooHyun Jung Date: Sat, 27 Aug 2016 13:48:35 +0900 Subject: [PATCH] elm focus: focus_auto_hide should be done with mouse_down Focus highlight can be on the air, when focused object in scroller is moved by mouse down and move. So, mouse up is not proper for executing focus_auto_hide. @fix --- src/lib/elementary/elm_widget.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c index b73661c14b..136d67f9db 100644 --- a/src/lib/elementary/elm_widget.c +++ b/src/lib/elementary/elm_widget.c @@ -294,10 +294,15 @@ _obj_mouse_down(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) { + Evas_Object *top; + ELM_WIDGET_DATA_GET(data, sd); Evas_Event_Mouse_Down *ev = event_info; - if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)) - sd->still_in = EINA_TRUE; + if ((ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)) return; + + top = elm_widget_top_get(data); + if (top && efl_isa(top, EFL_UI_WIN_CLASS)) _elm_win_focus_auto_hide(top); + sd->still_in = EINA_TRUE; } static void @@ -4059,12 +4064,9 @@ elm_widget_focus_mouse_up_handle(Evas_Object *obj) EOLIAN static void _elm_widget_focus_mouse_up_handle(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED) { - Evas_Object *top; - if (!obj) return; if (!_is_focusable(obj)) return; - top = elm_widget_top_get(obj); - if (top && efl_isa(top, EFL_UI_WIN_CLASS)) _elm_win_focus_auto_hide(top); + elm_widget_focus_steal(obj, NULL); }