[genlist] Added dragging queue for unrealize items that dragging option set by mouse...
authorYun ilkook <ilkook.yun@samsung.com>
Thu, 18 Aug 2011 00:17:12 +0000 (09:17 +0900)
committerYun ilkook <ilkook.yun@samsung.com>
Thu, 18 Aug 2011 00:17:12 +0000 (09:17 +0900)
Change-Id: I6742e3340cec03fe23dfe14ca9dced539aefb50d

src/lib/elm_genlist.c

index 444e48d..3764217 100644 (file)
@@ -57,6 +57,7 @@ struct _Widget_Data
    Eina_Bool         swipe : 1;
    Eina_Bool         reorder_mode : 1;
    Eina_Bool         reorder_pan_move : 1;
+   Eina_List        *dragging_queue;
    struct
    {
       Evas_Coord x, y;
@@ -1007,6 +1008,7 @@ _mouse_move(void        *data,
    if ((adx > minw) || (ady > minh))
      {
         it->dragging = EINA_TRUE;
+        it->wd->dragging_queue = eina_list_append(it->wd->dragging_queue, it);
         if (it->long_timer)
           {
              ecore_timer_del(it->long_timer);
@@ -1364,10 +1366,19 @@ _mouse_up(void        *data,
         ecore_timer_del(it->long_timer);
         it->long_timer = NULL;
      }
-   if (it->dragging)
+   while (it->wd->dragging_queue)
      {
-        it->dragging = EINA_FALSE;
-        evas_object_smart_callback_call(it->base.widget, SIG_DRAG_STOP, it);
+        Elm_Genlist_Item *dragging_it = NULL;
+        dragging_it = eina_list_data_get(it->wd->dragging_queue);
+        dragging_it->dragging = EINA_FALSE;
+        evas_object_smart_callback_call(dragging_it->base.widget, SIG_DRAG_STOP, dragging_it);
+        if (dragging_it->want_unrealize)
+          {
+             _item_unrealize(dragging_it, EINA_FALSE);
+             if (dragging_it->block->want_unrealize)
+               _item_block_unrealize(it->block);
+          }
+        it->wd->dragging_queue = eina_list_remove_list(it->wd->dragging_queue,it->wd->dragging_queue);
         dragged = 1;
      }
    if (it->swipe_timer)
@@ -1421,15 +1432,6 @@ _mouse_up(void        *data,
         it->wd->wasselected = EINA_FALSE;
         return;
      }
-   if (dragged)
-     {
-        if (it->want_unrealize)
-          {
-             _item_unrealize(it, EINA_FALSE);
-             if (it->block->want_unrealize)
-               _item_block_unrealize(it->block);
-          }
-     }
    if ((it->disabled) || (dragged) || (it->display_only)) return;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
    if (it->wd->multi)