[Genlist, Gengrid] If the focused item gets deleted, sd->focused must be NULL;
authorprince <prince.dubey@samsung.com>
Thu, 13 Jun 2013 12:00:22 +0000 (17:30 +0530)
committerSungho Kwak <sungho1.kwak@samsung.com>
Thu, 20 Jun 2013 12:31:08 +0000 (21:31 +0900)
Change-Id: Ie5ece264ec1bfdc36177a9d23fac18f9534aed96

src/lib/elm_gengrid.c
src/lib/elm_genlist.c

index 681ab42..11890d7 100644 (file)
@@ -2543,6 +2543,9 @@ _item_del_pre_fx_process(Elm_Gen_Item *it)
    evas_object_event_callback_del_full
       (VIEW(it), EVAS_CALLBACK_MOUSE_MOVE, _item_mouse_move_cb, it);
 
+   if (GG_IT(it)->wsd->focused == (Elm_Object_Item *)it)
+     GG_IT(it)->wsd->focused = NULL;
+
    GG_IT(it)->wsd->items = eina_inlist_remove
       (GG_IT(it)->wsd->items, EINA_INLIST_GET(it));
 
index 88f9580..bbf7e87 100644 (file)
@@ -5337,6 +5337,8 @@ _item_free_common(Elm_Gen_Item *it)
    if (sd->last_selected_item == (Elm_Object_Item *)it)
      sd->last_selected_item = NULL;
 
+   if (sd->focused == (Elm_Object_Item *)it) sd->focused = NULL;
+
    _item_event_del(it);
 
    sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(it));
@@ -5348,7 +5350,6 @@ _item_free(Elm_Gen_Item *it)
 {
    Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
 
-   if (sd->focused == it) sd->focused = NULL;
    elm_widget_item_pre_notify_del(it);
    if (it->itc->func.del)
      it->itc->func.del((void *)it->base.data, WIDGET(it));
@@ -5419,7 +5420,6 @@ _item_del_pre_process(Elm_Gen_Item *it)
           sd->pending_del_items = eina_list_append(sd->pending_del_items, it);
      }
 
-   if (sd->focused == it) sd->focused = NULL;
    elm_widget_item_pre_notify_del(it);
    if (it->itc->func.del)
      it->itc->func.del((void *)it->base.data, WIDGET(it));