app_grid: On longpress without move icon hang fix 50/65150/7
authorKamil Lipiszko <k.lipiszko@samsung.com>
Wed, 6 Apr 2016 11:58:46 +0000 (13:58 +0200)
committerKamil Lipiszko <k.lipiszko@samsung.com>
Thu, 7 Apr 2016 13:46:55 +0000 (06:46 -0700)
Change-Id: I5361f4428943fefaea0ba49bc1983664f26a29f4

src/app_grid.c

index f584a24..74bebbd 100644 (file)
@@ -441,12 +441,16 @@ static Eina_Bool __app_grid_icon_move_cb_del(void *data)
 static Evas_Event_Flags __app_grid_icon_move_end(void *data, void *event_info)
 {
        Elm_Gesture_Momentum_Info *pos_info = event_info;
-       LOGD("Drag end at: x,y=<%d,%d>", pos_info->x2, pos_info->y2);
-
 
        if(s_info.repositioned_icon != NULL) {
-               __app_grid_icon_drop(NULL, s_info.src_grid, pos_info->x2,
-                               pos_info->y2, ELM_XDND_ACTION_UNKNOWN);
+
+               if (pos_info != NULL) {
+                       LOGD("Drag end at: x,y=<%d,%d>", pos_info->x2, pos_info->y2);
+
+                       __app_grid_icon_drop(NULL, s_info.src_grid, pos_info->x2,
+                                       pos_info->y2, ELM_XDND_ACTION_MOVE);
+               }
+
                __app_grid_drag_done(NULL, NULL);
        }
 
@@ -591,6 +595,11 @@ static void __app_grid_resize_cb(void *data, Evas *e, Evas_Object *obj, void *ei
 /*=========================== MOUSE HANDLERS =====================================================*/
 static Eina_Bool __app_grid_mouse_up_cb(void *data, int type, void *event)
 {
+       LOGD("");
+
+       if (s_info.is_dnd_on)
+               __app_grid_icon_move_end(NULL, NULL);
+
        home_screen_set_indice_state(INDICE_OFF);
        return ECORE_CALLBACK_RENEW;
 }