genlist: fix multiple focus edje signal issue
authorAmitesh Singh <amitesh.sh@samsung.com>
Tue, 11 Jul 2017 06:12:45 +0000 (15:12 +0900)
committerAmitesh Singh <amitesh.sh@samsung.com>
Tue, 11 Jul 2017 06:17:09 +0000 (15:17 +0900)
We need focus edje signal when item is focused or the already
focused item realizes. its wrong to call focus signal on
_elm_genlist_item_state_update()

fixes T4969

src/lib/elementary/elm_genlist.c

index d184984..73b5fc0 100644 (file)
@@ -1320,8 +1320,6 @@ _item_order_update(Elm_Gen_Item *it, int index, Eina_Bool process)
 static void
 _elm_genlist_item_state_update(Elm_Gen_Item *it)
 {
-   ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
-
    if (it->selected)
      {
         edje_object_signal_emit(VIEW(it), SIGNAL_SELECTED, "elm");
@@ -1343,9 +1341,6 @@ _elm_genlist_item_state_update(Elm_Gen_Item *it)
           edje_object_signal_emit
              (it->deco_all_view, SIGNAL_EXPANDED, "elm");
      }
-   if ((EO_OBJ(it) == sd->focused_item) &&
-       (elm_widget_focus_highlight_enabled_get(WIDGET(it)) || _elm_config->win_auto_focus_enable))
-     edje_object_signal_emit(VIEW(it), SIGNAL_FOCUSED, "elm");
 }
 
 static void
@@ -1785,7 +1780,8 @@ _elm_genlist_item_focus_update(Elm_Gen_Item *it)
    Evas_Object *obj = WIDGET(it);
    ELM_GENLIST_DATA_GET(obj, sd);
 
-   if (elm_widget_focus_highlight_enabled_get(obj))
+   if (elm_widget_focus_highlight_enabled_get(obj)
+       || _elm_config->win_auto_focus_enable)
      edje_object_signal_emit(VIEW(it), SIGNAL_FOCUSED, "elm");
 
    focus_raise = edje_object_data_get(VIEW(it), "focusraise");