From d5f25f998bb5a5cb8aefbba8679e63ffa0062d55 Mon Sep 17 00:00:00 2001 From: Johannes Mueller Date: Mon, 13 Apr 2020 22:14:32 +0200 Subject: [PATCH] Fix #7007: ::clear_owned_changes() on rippled Playlist before commit RegionMoveDrag::finished_no_copy() calls ::clear_changes() on every selected Region and then sets their positions again before committing the command to the UndoHistory. By doing that no changes from the previous transaction spill over into the current transaction. This needs to be done in a similar way by in RegionRippleDrag::finished() because otherwise a following undo action would also undo the changes of the previous transaction for all the non selected rippled regions. RegionRippleDrags across tracks are still borked, though. --- gtk2_ardour/editor_drag.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 81d3bae02d..32fd9a1935 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2414,7 +2414,6 @@ RegionRippleDrag::finished (GdkEvent* event, bool movement_occurred) // remove the regions being rippled from the dragging view, updating them to // their new positions - remove_unselected_from_views (prev_amount, true); if (allow_moves_across_tracks) { if (orig_tav) { @@ -2422,6 +2421,8 @@ RegionRippleDrag::finished (GdkEvent* event, bool movement_occurred) // regions on the track the regions were dragged off, so we need // to add the original track to the undo record orig_tav->playlist()->clear_changes(); + orig_tav->playlist()->clear_owned_changes(); + remove_unselected_from_views (prev_amount, true); vector cmds; orig_tav->playlist()->rdiff (cmds); _editor->session()->add_commands (cmds); @@ -2440,6 +2441,11 @@ RegionRippleDrag::finished (GdkEvent* event, bool movement_occurred) for (pi = playlists.begin(); pi != playlists.end(); ++pi) { (*pi)->clear_changes(); + (*pi)->clear_owned_changes(); + } + remove_unselected_from_views (prev_amount, true); + + for (pi = playlists.begin(); pi != playlists.end(); ++pi) { vector cmds; (*pi)->rdiff (cmds); _editor->session()->add_commands (cmds);