From be1396d06626c12c7da85dcd076c8959fd2ccd24 Mon Sep 17 00:00:00 2001 From: nick_m Date: Mon, 5 Oct 2015 02:56:56 +1100 Subject: [PATCH] Select the control point about to be deleted when using shift + right click. - fixes incorrect selection changes when doing this. --- gtk2_ardour/automation_line.cc | 1 + gtk2_ardour/editor_mouse.cc | 8 ++++++-- gtk2_ardour/region_gain_line.cc | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index cb59e6d571..72cf283ff4 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -882,6 +882,7 @@ AutomationLine::remove_point (ControlPoint& cp) trackview.editor().begin_reversible_command (_("remove control point")); XMLNode &before = alist->get_state(); + trackview.editor ().get_selection ().clear_points (); alist->erase (cp.model()); trackview.editor().session()->add_command( diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index f49c5983a8..297483d563 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -458,7 +458,7 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it /* almost no selection action on modified button-2 or button-3 events */ - if (item_type != RegionItem && event->button.button != 2) { + if ((item_type != RegionItem && event->button.button != 2) && !(item_type == ControlPointItem && event->button.button == 3)) { return; } } @@ -519,7 +519,11 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it /* for object/track exclusivity, we don't call set_selected_track_as_side_effect (op); */ if (eff_mouse_mode != MouseRange) { - _mouse_changed_selection |= set_selected_control_point_from_click (press, op); + if (event->button.button != 3) { + _mouse_changed_selection |= set_selected_control_point_from_click (press, op); + } else { + _mouse_changed_selection |= set_selected_control_point_from_click (press, Selection::Set); + } } break; diff --git a/gtk2_ardour/region_gain_line.cc b/gtk2_ardour/region_gain_line.cc index 7a748c8749..dc1c14e437 100644 --- a/gtk2_ardour/region_gain_line.cc +++ b/gtk2_ardour/region_gain_line.cc @@ -81,6 +81,7 @@ AudioRegionGainLine::remove_point (ControlPoint& cp) trackview.session()->add_command(new StatefulDiffCommand (rv.audio_region())); } + trackview.editor ().get_selection ().clear_points (); alist->erase (cp.model()); trackview.editor().session()->add_command (new MementoCommand(*alist.get(), &before, &alist->get_state()));