From 7cf435a8765b67956cd3686b005bbbec87c5a28e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 18 Jan 2021 16:06:51 -0700 Subject: [PATCH] deselect everything when the first MIDI note is selected See comments in code for more information --- gtk2_ardour/midi_region_view.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 02fd84a4d6..022885d0e5 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -2460,8 +2460,20 @@ MidiRegionView::add_to_selection (NoteBase* ev) { if (_selection.empty()) { + /* we're about to select a note/some notes. Obey rule that only + * 1 thing can be selected by clearing any current selection + */ + + trackview.editor().get_selection().clear (); + /* first note selected in this region, force Editor region * selection to this region. + * + * this breaks the "only 1 type of thing selected" rule, but + * having the region selected allows "operations applied to + * selected MIDI regions" to work. And we can only select notes + * when in internal edit mode, so we know that operations will + * only apply to notes anyway, not regions. */ trackview.editor().set_selected_midi_region_view (*this);