Revert to old Lock mode (still called Lock).
[ardour.git] / gtk2_ardour / editor_drag.cc
index c21622dd4a5177b3851265c7ec0d70354784d142..0e75c48cdb1aa0cd882edf5065fd840f80232e58 100644 (file)
@@ -339,7 +339,7 @@ Drag::adjusted_current_frame (GdkEvent const * event, bool snap) const
 frameoffset_t
 Drag::snap_delta (GdkEvent const * event) const
 {
-       if (Keyboard::modifier_state_contains (event->button.state, Keyboard::TertiaryModifier)) {
+       if (Keyboard::modifier_state_equals (event->button.state, Keyboard::snap_delta_modifier())) {
                return 0;
        } else {
                return _snap_delta;
@@ -401,18 +401,27 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll)
                                /* just changed */
 
                                if (fabs (current_pointer_y() - _grab_y) > fabs (current_pointer_x() - _grab_x)) {
-                                       if (event->motion.state & Gdk::BUTTON2_MASK) {
+                                       if ((event->motion.state & Gdk::BUTTON2_MASK) && Config->get_edit_mode() != Lock) {
                                                _x_constrained = true;
                                                _y_constrained = false;
                                        }
                                        _initially_vertical = true;
                                } else {
-                                       if (event->motion.state & Gdk::BUTTON2_MASK) {
+                                       if ((event->motion.state & Gdk::BUTTON2_MASK) && Config->get_edit_mode() != Lock) {
                                                _x_constrained = false;
                                                _y_constrained = true;
                                        }
                                        _initially_vertical = false;
                                }
+
+                               if (Config->get_edit_mode() == Lock) {
+                                       if (event->button.state & Gdk::BUTTON2_MASK) {
+                                               _x_constrained = false;
+                                       } else {
+                                               _x_constrained = true;
+                                       }
+                                       _y_constrained = false;
+                               }
                        }
 
                        if (!from_autoscroll) {
@@ -631,8 +640,7 @@ RegionMotionDrag::compute_x_delta (GdkEvent const * event, framepos_t* pending_r
 
        double dx = 0;
 
-       /* in locked edit mode, reverse the usual meaning of _x_constrained */
-       bool const x_move_allowed = Config->get_edit_mode() == Lock ? _x_constrained : !_x_constrained;
+       bool const x_move_allowed = !_x_constrained;
 
        if ((*pending_region_position != _last_frame_position) && x_move_allowed) {
 
@@ -1307,14 +1315,6 @@ RegionMoveDrag::finished (GdkEvent* ev, bool movement_occurred)
                return;
        }
 
-       /* reverse this here so that we have the correct logic to finalize
-          the drag.
-       */
-
-       if (Config->get_edit_mode() == Lock) {
-               _x_constrained = !_x_constrained;
-       }
-
        assert (!_views.empty ());
 
        /* We might have hidden region views so that they weren't visible during the drag
@@ -2394,7 +2394,7 @@ NoteResizeDrag::motion (GdkEvent* event, bool /*first_move*/)
                MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*r);
                if (mrv) {
                        double sd = 0.0;
-                       if (Keyboard::modifier_state_contains (event->button.state, Keyboard::TertiaryModifier)) {
+                       if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::snap_delta_modifier())) {
                                sd = _snap_delta;
                        }
                        mrv->update_resizing (nb, at_front, _drags->current_pointer_x() - grab_x(), relative, sd);
@@ -2411,7 +2411,7 @@ NoteResizeDrag::finished (GdkEvent* event, bool /*movement_occurred*/)
                assert (nb);
                MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*r);
                double sd = 0.0;
-               if (Keyboard::modifier_state_contains (event->button.state, Keyboard::TertiaryModifier)) {
+               if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::snap_delta_modifier())) {
                        sd = _snap_delta;
                }
                if (mrv) {