View Issue Details

IDProjectCategoryView StatusLast Update
0003729ardourbugspublic2020-04-19 20:15
Reporterlincoln Assigned Tocth103  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Summary0003729: Undo stops working following rubber band selection
DescriptionUndo will stop working after making a rubber band region selection. This is due to a nested undo transaction not being properly committed, leaving the parent transaction unresolved when it commits.

Attached patch clears this.
TagsNo tags attached.

Activities

2011-01-23 22:06

 

selection-nested-undo-transaction-fix.patch (2,501 bytes)   
Index: gtk2_ardour/editor_drag.cc
===================================================================
--- gtk2_ardour/editor_drag.cc	(revision 8562)
+++ gtk2_ardour/editor_drag.cc	(working copy)
@@ -3044,15 +3044,12 @@
 		_editor->begin_reversible_command (_("rubberband selection"));
 
 		if (grab_frame() < last_pointer_frame()) {
-			committed = _editor->select_all_within (grab_frame(), last_pointer_frame() - 1, y1, y2, _editor->track_views, op, false);
+			_editor->select_all_within (grab_frame(), last_pointer_frame() - 1, y1, y2, _editor->track_views, op, false);
 		} else {
-			committed = _editor->select_all_within (last_pointer_frame(), grab_frame() - 1, y1, y2, _editor->track_views, op, false);
+			_editor->select_all_within (last_pointer_frame(), grab_frame() - 1, y1, y2, _editor->track_views, op, false);
 		}
 
-		if (!committed) {
-			_editor->commit_reversible_command ();
-		}
-
+		_editor->commit_reversible_command ();
 	} else {
 		if (!getenv("ARDOUR_SAE")) {
 			_editor->selection->clear_tracks();
Index: gtk2_ardour/editor_selection.cc
===================================================================
--- gtk2_ardour/editor_selection.cc	(revision 8562)
+++ gtk2_ardour/editor_selection.cc	(working copy)
@@ -1275,7 +1275,7 @@
  *  @param preserve_if_selected true to leave the current selection alone if we're adding to the selection and all of the selectables
  *  within the region are already selected.
  */
-bool
+void
 Editor::select_all_within (
 	framepos_t start, framepos_t end, double top, double bot, const TrackViewList& tracklist, Selection::Operation op, bool preserve_if_selected
 	)
@@ -1292,7 +1292,7 @@
 	}
 
 	if (found.empty()) {
-		return false;
+		return;
 	}
 
 	if (preserve_if_selected && op != Selection::Toggle) {
@@ -1302,7 +1302,7 @@
 		}
 
 		if (i == found.end()) {
-			return false;
+			return;
 		}
 	}
 
@@ -1323,8 +1323,6 @@
 	}
 
 	commit_reversible_command ();
-
-	return !found.empty();
 }
 
 void
Index: gtk2_ardour/editor.h
===================================================================
--- gtk2_ardour/editor.h	(revision 8562)
+++ gtk2_ardour/editor.h	(working copy)
@@ -1658,7 +1658,7 @@
 
 	/* object rubberband select process */
 
-	bool select_all_within (framepos_t, framepos_t, double, double, TrackViewList const &, Selection::Operation, bool);
+	void select_all_within (framepos_t, framepos_t, double, double, TrackViewList const &, Selection::Operation, bool);
 
 	ArdourCanvas::SimpleRect   *rubberband_rect;
 

cth103

2011-01-23 23:14

administrator   ~0009972

Patch applied to SVN. Thanks!

system

2020-04-19 20:15

developer   ~0022378

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2011-01-23 22:06 lincoln New Issue
2011-01-23 22:06 lincoln File Added: selection-nested-undo-transaction-fix.patch
2011-01-23 23:14 cth103 cost => 0.00
2011-01-23 23:14 cth103 Note Added: 0009972
2011-01-23 23:14 cth103 Status new => resolved
2011-01-23 23:14 cth103 Resolution open => fixed
2011-01-23 23:14 cth103 Assigned To => cth103
2020-04-19 20:15 system Note Added: 0022378
2020-04-19 20:15 system Status resolved => closed