diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 9d2f6065e0..057a3e478a 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -1077,6 +1077,17 @@ RegionMoveDrag::finished_no_copy ( } else { + boost::shared_ptr playlist = dest_rtv->playlist(); + + /* this movement may result in a crossfade being modified, or a layering change, + so we need to get undo data from the playlist as well as the region. + */ + + pair r = modified_playlists.insert (playlist); + if (r.second) { + playlist->clear_changes (); + } + rv->region()->clear_changes (); /* @@ -1090,30 +1101,18 @@ RegionMoveDrag::finished_no_copy ( rv->drag_end (); /* just change the model */ - - boost::shared_ptr playlist = dest_rtv->playlist(); - if (dest_rtv->view()->layer_display() == Stacked || dest_rtv->view()->layer_display() == Expanded) { playlist->set_layer (rv->region(), dest_layer); } /* freeze playlist to avoid lots of relayering in the case of a multi-region drag */ - pair r = frozen_playlists.insert (playlist); + r = frozen_playlists.insert (playlist); if (r.second) { playlist->freeze (); } - /* this movement may result in a crossfade being modified, so we need to get undo - data from the playlist as well as the region. - */ - - r = modified_playlists.insert (playlist); - if (r.second) { - playlist->clear_changes (); - } - rv->region()->set_position (where); _editor->session()->add_command (new StatefulDiffCommand (rv->region()));