From 1fbd7c7124e60a07bc99290272dcaf211eecabc9 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 24 Jun 2025 18:11:13 -0600 Subject: [PATCH] when selecting a due to note selection, do not keep changing the selection the code was first clearing the entire Editor selection before adding the region, causing every note selection to trigger the RegionsChanged pathway. This is crazy expensive for some reason (more than 8.12) and that should be investigated, but the logic is also wrong. Selecting a region that is alrready the sole selected region should not cause any action at all. --- gtk2_ardour/midi_view.cc | 6 ------ gtk2_ardour/selection.cc | 6 ++++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/gtk2_ardour/midi_view.cc b/gtk2_ardour/midi_view.cc index 626d3f5394..8c1661b2e0 100644 --- a/gtk2_ardour/midi_view.cc +++ b/gtk2_ardour/midi_view.cc @@ -2726,12 +2726,6 @@ MidiView::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 - */ - - _editing_context.get_selection().clear (); - /* first note selected in this region, force Editor region * selection to this region. * diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 0f63147e96..17c1e72897 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -723,8 +723,10 @@ Selection::set (RegionView* r, bool /*also_clear_tracks*/) clear_time(); // enforce region/object exclusivity clear_tracks(); // enforce object/track exclusivity } - clear_objects (); - add (r); + if (!regions.contains (r) || regions.size() != 1) { + clear_objects (); + add (r); + } } void