[Summary] Fixed bug 45163: Trim range from right corner of timeline leads Tracks...
authorGZharun <grygoriiz@wavesglobal.com>
Fri, 23 Jan 2015 12:46:23 +0000 (14:46 +0200)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 23 Jan 2015 18:43:52 +0000 (13:43 -0500)
[Details] Crash was provoked because of an attempt to add commands to the session reversible command, but when autoscroll started and trim began with autoscroll the session reversible command was not created for for Trim Drag.

gtk2_ardour/editor_drag.cc
gtk2_ardour/editor_drag.h

index eca6131f0355e26698eb4e9da74cf4cc7d817bba..a98fe2556810f96700f4c00f32cf4fee3471632a 100644 (file)
@@ -219,6 +219,7 @@ Drag::Drag (Editor* e, ArdourCanvas::Item* i, bool trackview_only)
        , _pointer_frame_offset (0)
        , _trackview_only (trackview_only)
        , _move_threshold_passed (false)
+    , _starting_point_passed (false)
        , _was_double_click (false)
        , _raw_grab_frame (0)
        , _grab_frame (0)
@@ -369,7 +370,7 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll)
 
        bool const old_move_threshold_passed = _move_threshold_passed;
 
-       if (!from_autoscroll && !_move_threshold_passed) {
+       if (!_move_threshold_passed) {
 
                bool const xp = (::llabs (_drags->current_pointer_frame () - _raw_grab_frame) >= threshold.first);
                bool const yp = (::fabs ((current_pointer_y () - _grab_y)) >= threshold.second);
@@ -385,7 +386,13 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll)
                        }
 
                        if (!_editor->autoscroll_active() || from_autoscroll) {
-                               motion (event, _move_threshold_passed != old_move_threshold_passed);
+                
+                bool first_move = (_move_threshold_passed != old_move_threshold_passed) ||
+                                   from_autoscroll;
+                
+                               motion (event, first_move && !_starting_point_passed);
+                               
+                _starting_point_passed = first_move;
                                
                                _last_pointer_x = _drags->current_pointer_x ();
                                _last_pointer_y = current_pointer_y ();
index c7c2f23b1a6f36c142bba9b1c1226a65019a3866..ef4a0f0b28830a6630cb5bfb7dd2ab01dc2656e0 100644 (file)
@@ -233,6 +233,7 @@ protected:
 private:
        bool _trackview_only; ///< true if pointer y value should always be relative to the top of the trackview group
        bool _move_threshold_passed; ///< true if the move threshold has been passed, otherwise false
+    bool _starting_point_passed; ///< true if we called move () with first_move flag, otherwise false
         bool _was_double_click; ///< true if drag initiated by a double click event
        double _grab_x; ///< trackview x of the grab start position
        double _grab_y; ///< y of the grab start position, possibly adjusted if _trackview_only is true