genlist: set focus before item bring in or show
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Mon, 20 Apr 2020 11:56:48 +0000 (20:56 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 5 May 2020 23:37:34 +0000 (08:37 +0900)
Change-Id: I1833258d2e7e540b7e963dfdc2d3afd9e1a9960a
Signed-off-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
src/lib/elementary_tizen/elm_genlist.c

index 24691c4..b4ae4ef 100644 (file)
@@ -3536,14 +3536,12 @@ static void _item_focused(Elm_Gen_Item *it, Elm_Genlist_Item_Scrollto_Type type)
    Elm_Genlist_Data *sd = GL_IT(it)->wsd;
    Evas_Object *win = elm_widget_top_get(sd->obj);
 
-   sd->on_focus_defer = EINA_FALSE;
-
    evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
    evas_object_geometry_get(sd->obj, &sx, &sy, &sw, &sh);
    if ((x < sx) || (y < sy) || ((x + w) > (sx + sw)) || ((y + h) > (sy + sh)))
      {
         //TIZEN_ONLY(20191217): Item selection support for non aligned items
-        if (it != sd->selecting_item)
+        if ((it != sd->selecting_item) && !sd->on_focus_defer)
         //
           elm_genlist_item_bring_in(EO_OBJ(it), type);
      }
@@ -3558,6 +3556,7 @@ static void _item_focused(Elm_Gen_Item *it, Elm_Genlist_Item_Scrollto_Type type)
             (VIEW(it), SIGNAL_FOCUSED, "elm");
      }
 
+   sd->on_focus_defer = EINA_FALSE;
    sd->focused_item = EO_OBJ(it);
    efl_event_callback_legacy_call(WIDGET(it), ELM_GENLIST_EVENT_ITEM_FOCUSED, EO_OBJ(it));
    if (_elm_atspi_enabled())
@@ -9104,6 +9103,7 @@ _elm_genlist_item_show(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, Elm_Genlist_It
 
    sd->bring_in = EINA_FALSE;
    sd->scroll_to_type = type;
+   if (sd->on_focus_defer) elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
    _changed(sd->pan_obj);
 }
 
@@ -9147,6 +9147,7 @@ _elm_genlist_item_bring_in(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, Elm_Genlis
      sd->show_item = it;
 
    sd->scroll_to_type = type;
+   if (sd->on_focus_defer) elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
    _changed(sd->pan_obj);
 }