genlist : arrange focus set in mouse up 46/66946/2
authorSangHyeon Lee <sh10233.lee@samsung.com>
Fri, 22 Apr 2016 07:15:15 +0000 (16:15 +0900)
committerSangHyeon Lee <sh10233.lee@samsung.com>
Thu, 19 May 2016 08:35:05 +0000 (01:35 -0700)
Summary :
when mouse up happens, item must be focused, and after that,
select must be called.
current logic, focus is already called inside the select function
and again focus set is called in the end of mouse_up,
so if user new focused widget inside the select callback,
mouse_up forcely take the focus into the item again.
select callback should comes after the focus callback calls
to work properly.

Change-Id: I11401daecfa56c7036f23bc221796d81210966ee
Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
src/lib/elm_genlist.c

index a2a76bceed183d4c635f49841b349664ba0f1a6b..fccccb9a45a1647a42fc2de5b8318cc61a8bd638 100644 (file)
@@ -4926,6 +4926,9 @@ _item_mouse_up_cb(void *data,
 
    evas_object_ref(sd->obj);
 
+   if (sd->focused_item != EO_OBJ(it))
+     elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
+
    if (sd->multi &&
        ((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) ||
         (evas_key_modifier_is_set(ev->modifiers, "Control"))))
@@ -4965,9 +4968,6 @@ _item_mouse_up_cb(void *data,
         if (_item_select(it)) goto deleted;
      }
 
-   if (sd->focused_item != EO_OBJ(it))
-     elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
-
 deleted:
    evas_object_unref(sd->obj);
 }