elm focus: focus_auto_hide should be done with mouse_down 47/85947/1 accepted/tizen/common/20160830.150517 submit/tizen/20160830.112906
authorWooHyun Jung <wh0705.jung@samsung.com>
Mon, 29 Aug 2016 23:56:10 +0000 (08:56 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Mon, 29 Aug 2016 23:56:10 +0000 (08:56 +0900)
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

Change-Id: Ibc944ac0a1be7c1afb0e4067038eee6232ea903f

src/lib/elm_widget.c

index 02fdacd..2fb5fa0 100644 (file)
@@ -315,10 +315,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 && eo_isa(top, ELM_WIN_CLASS)) _elm_win_focus_auto_hide(top);
+   sd->still_in = EINA_TRUE;
 }
 
 static void
@@ -4147,12 +4152,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 && eo_isa(top, ELM_WIN_CLASS)) _elm_win_focus_auto_hide(top);
+
    elm_widget_focus_steal(obj, NULL);
 }