From 576403c4cbd0b476283873e1190e70c67ccd674f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 6 May 2024 10:10:47 -0600 Subject: [PATCH] no track movement up/down when a selected track is already at the relevant edge --- gtk2_ardour/editor_selection.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 6984376ed6..a4e4e48ef1 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -2398,6 +2398,20 @@ Editor::move_selected_tracks (bool up) sl.sort (Stripable::Sorter()); + /* Check if the selected tracks are already at the beginning or end of + * the ordering, depending on direction. + */ + + for (auto & s : sl) { + if (s->is_selected()) { + if (up && (s->presentation_info().order() <= 1)) { + return; + } else if (!up && (s->presentation_info().order() >= sl.size() - 1)) { + return; + } + } + } + std::list view_stripables; /* build a list that includes time axis view information */