yakov pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=0c7231b893a9a3721ba8048ec2cf28ea205976ef

commit 0c7231b893a9a3721ba8048ec2cf28ea205976ef
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Thu Oct 29 15:34:18 2015 +0200

    Fix bug in  main widget's DnD
    
    - mouse down callback were added to frame several times
---
 src/bin/gui/editor.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/bin/gui/editor.c b/src/bin/gui/editor.c
index 1e46fa0..2b5b76f 100644
--- a/src/bin/gui/editor.c
+++ b/src/bin/gui/editor.c
@@ -622,8 +622,6 @@ _mouse_up_main(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, 
const Eo_Event_Descr
         ecore_timer_del(_drag_timer_start);
         _drag_timer_start = NULL;
      }
-   if (!drag_started) return EO_CALLBACK_CONTINUE;
-
    return EO_CALLBACK_CONTINUE;
 }
 
@@ -1135,7 +1133,7 @@ _frame_mouse_down(void *data EINA_UNUSED, Eo *obj, const 
Eo_Event_Description *d
      }
    else
      {
-        _drag_timer_start = ecore_timer_add(0.1, _drag_widget_start, wdg);
+        _drag_timer_start = ecore_timer_add(0.2, _drag_widget_start, wdg);
      }
    return EO_CALLBACK_CONTINUE;
 }
@@ -1149,6 +1147,14 @@ _frame_mouse_up(void *data EINA_UNUSED, Eo *obj, const 
Eo_Event_Description *des
      {
         eo_do(obj, eo_event_callback_del(EVAS_OBJECT_EVENT_MOUSE_MOVE, 
_frame_mouse_move, NULL));
      }
+   else
+     {
+        if (_drag_timer_start)
+          {
+             ecore_timer_del(_drag_timer_start);
+             _drag_timer_start = NULL;
+          }
+     }
    return EO_CALLBACK_CONTINUE;
 }
 
@@ -2549,6 +2555,8 @@ _widget_add(Gui_Session *session, const Gui_Widget *wdg, 
void *data EINA_UNUSED)
           {
              wi = main_wdg_info_new();
              fr = eo_add(ELM_FRAME_CLASS, parent_win);
+             eo_do(fr, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_DOWN, 
_frame_mouse_down, NULL));
+             eo_do(fr, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_UP, 
_frame_mouse_up, NULL));
              main_wdg_info_frame_set(wi, fr);
              wdg_data_set(wdg, MAIN_WDG_INFO, wi);
           }
@@ -2583,8 +2591,6 @@ _widget_add(Gui_Session *session, const Gui_Widget *wdg, 
void *data EINA_UNUSED)
               efl_gfx_visible_set(EINA_TRUE),
               elm_obj_frame_autocollapse_set(EINA_TRUE));
 
-        eo_do(fr, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_DOWN, 
_frame_mouse_down, NULL));
-        eo_do(fr, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_UP, 
_frame_mouse_up, NULL));
         eo_do(fr, eo_key_data_set("winwdg", wdg));
 
         eo_do(fr, elm_obj_widget_theme_set(theme));

-- 


Reply via email to