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.
This commit is contained in:
Paul Davis 2025-06-24 18:11:13 -06:00
parent 0c876d7c44
commit 1fbd7c7124
2 changed files with 4 additions and 8 deletions

View file

@ -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.
*

View file

@ -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