From 01747f54d8c17c3812868e4167186f9655bf0791 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 27 Oct 2016 03:32:59 +0200 Subject: Prevent duplicate moves when selecting regions on shared playlists selecting regions on multiple tracks which share playlists and dragging them has various odd side-effects. This prevents the worst of such edge-cases. A cleaner solution would be to not allow selecting the same region on multiple tracks at the same time in the first place. Comments are welcome. --- gtk2_ardour/editor_drag.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 63b22bcc14..5ed00274dc 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -1529,6 +1529,7 @@ RegionMoveDrag::finished_no_copy ( typedef map, RouteTimeAxisView*> PlaylistMapping; PlaylistMapping playlist_mapping; + std::set > uniq; for (list::const_iterator i = _views.begin(); i != _views.end(); ) { RegionView* rv = i->view; @@ -1539,6 +1540,13 @@ RegionMoveDrag::finished_no_copy ( continue; } + if (uniq.find (rv->region()) != uniq.end()) { + /* prevent duplicate moves when selecting regions from shared playlists */ + ++i; + continue; + } + uniq.insert(rv->region()); + if (i->time_axis_view < 0 || i->time_axis_view >= (int)_time_axis_views.size()) { /* dragged to drop zone */ -- cgit v1.2.3