Drag and drop 2.5 integration! Finally, slashdot regulars can use
[blender-staging.git] / source / blender / windowmanager / intern / wm_gesture.c
index e94aab7ab893a4efcf135e6a36736ebaac15369e..47d8c8d983169b63657ab9cb518fa1898ad34f08 100644 (file)
@@ -101,11 +101,24 @@ wmGesture *WM_gesture_new(bContext *C, wmEvent *event, int type)
 
 void WM_gesture_end(bContext *C, wmGesture *gesture)
 {
-       BLI_remlink(&CTX_wm_window(C)->gesture, gesture);
+       wmWindow *win= CTX_wm_window(C);
+       
+       if(win->tweak==gesture)
+               win->tweak= NULL;
+       BLI_remlink(&win->gesture, gesture);
        MEM_freeN(gesture->customdata);
        MEM_freeN(gesture);
 }
 
+void WM_gestures_remove(bContext *C)
+{
+       wmWindow *win= CTX_wm_window(C);
+       
+       while(win->gesture.first)
+               WM_gesture_end(C, win->gesture.first);
+}
+
+
 /* tweak and line gestures */
 #define TWEAK_THRESHOLD                10
 int wm_gesture_evaluate(bContext *C, wmGesture *gesture)
@@ -338,3 +351,4 @@ void wm_gesture_tag_redraw(bContext *C)
                ED_region_tag_redraw(ar);
 }
 
+