diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index f13e38cbef..adc61813e4 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -112,6 +112,7 @@ AutomationLine::AutomationLine (const string& name, line = new ArdourCanvas::PolyLine (group); CANVAS_DEBUG_NAME (line, "region gain envelope line"); line->set_data ("line", this); + line->set_data ("trackview", &trackview); line->set_outline_width (2.0); line->set_covers_threshold (4.0); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 5ac777375d..d04f2101ca 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -619,7 +619,7 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it case ControlPointItem: /* for object/track exclusivity, we don't call set_selected_track_as_side_effect (op); */ - if (eff_mouse_mode != MouseRange) { + if (eff_mouse_mode == MouseContent) { if (event->button.button != 3) { _mouse_changed_selection |= set_selected_control_point_from_click (press, op); } else { @@ -1242,11 +1242,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT _drags->set (new LineDrag (this, item), event); return true; - case ControlPointItem: - _drags->set (new ControlPointDrag (this, item), event); - return true; - break; - case SelectionItem: { if (selection->time.empty ()) { @@ -1335,6 +1330,10 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT break; } + case ControlPointItem: + item = &(static_cast (item->get_data ("control_point"))->line().grab_item()); + /*fallthrough*/ + case AutomationLineItem: case AutomationTrackItem: { AutomationTimeAxisView* atv = static_cast (item->get_data ("trackview")); @@ -1344,10 +1343,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT } break; - case AutomationLineItem: - _drags->set (new LineDrag (this, item), event); - break; - case NoteItem: if ((note = reinterpret_cast(item->get_data ("notebase")))) { if (note->big_enough_to_trim() && note->mouse_near_ends()) { diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 1445e3d859..a78fa9b2e5 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -327,6 +327,10 @@ Editor::set_selected_control_point_from_click (bool press, Selection::Operation return false; } + if (mouse_mode != Editing::MouseContent) { + return false; + } + bool ret = false; switch (op) {