diff options
author | Robin Gareus <robin@gareus.org> | 2016-10-27 03:32:59 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-10-27 03:33:51 +0200 |
commit | 01747f54d8c17c3812868e4167186f9655bf0791 (patch) | |
tree | 6d20376f351234597832a35758f55eb7289bf837 /gtk2_ardour/editor_drag.cc | |
parent | 8d70b760598d0510f757c8b0653230f4cbec89cc (diff) |
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.
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 8 |
1 files changed, 8 insertions, 0 deletions
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<boost::shared_ptr<Playlist>, RouteTimeAxisView*> PlaylistMapping; PlaylistMapping playlist_mapping; + std::set<boost::shared_ptr<const Region> > uniq; for (list<DraggingView>::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 */ |