+ /** check constraints for this drag.
+ * Note that the current convention is to use "contains" for
+ * key modifiers during motion and "equals" when initiating a drag.
+ * In this case we haven't moved yet, so "equals" applies here.
+ */
+ if (Config->get_edit_mode() != Lock) {
+ if (event->motion.state & Gdk::BUTTON2_MASK) {
+ // if dragging with button2, the motion is x constrained, with constraint modifier it is y constrained
+ if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::constraint_modifier ())) {
+ _x_constrained = false;
+ _y_constrained = true;
+ } else {
+ _x_constrained = true;
+ _y_constrained = false;
+ }
+ } else if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::constraint_modifier ())) {
+ // if dragging normally, the motion is constrained to the first direction of movement.
+ if (_initially_vertical) {
+ _x_constrained = true;
+ _y_constrained = false;
+ } else {
+ _x_constrained = false;
+ _y_constrained = true;
+ }
+ }
+ } else {