View Issue Details

IDProjectCategoryView StatusLast Update
0005515ardourbugspublic2015-09-18 15:29
Reportercolinf Assigned Tocolinf  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Summary0005515: Existing selection is ignored for mouse events on regions in active edit group
DescriptionIf a region is part of an active edit group (with the 'selection' property enabled), then clicking on that region in object mode clears the current region selection and selects all equivalent regions of the clicked region instead.

Thus, click+drag on the region resize or fade in/out handles, and click+drag to move regions, always operates on the equivalent regions in the edit group, and not on any pre-selected regions

I think this behaviour is wrong: if the region selection is not empty, the user has presumably selected some regions so that subsequent operations should apply to them, so if the clicked region is one of the selected regions, mouse operations on that region should be applied to the extant selection.
Additional InformationI have a patch, which I'll attach here in a moment, and commit later if no-one has any objections.
TagsNo tags attached.

Activities

2013-06-07 09:14

 

5515.patch (5,117 bytes)   
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 00156a9..c7daeac 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -861,8 +861,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
 
 		case RegionViewNameHighlight:
 			if (!clicked_regionview->region()->locked()) {
-				RegionSelection s = get_equivalent_regions (selection->regions, Properties::select.property_id);
-				_drags->set (new TrimDrag (this, item, clicked_regionview, s.by_layer()), event);
+				_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer()), event);
 				return true;
 			}
 			break;
@@ -935,15 +934,13 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
 			switch (item_type) {
 			case FadeInHandleItem:
 			{
-				RegionSelection s = get_equivalent_regions (selection->regions, Properties::select.property_id);
-				_drags->set (new FadeInDrag (this, item, reinterpret_cast<RegionView*> (item->get_data("regionview")), s), event, _cursors->fade_in);
+				_drags->set (new FadeInDrag (this, item, reinterpret_cast<RegionView*> (item->get_data("regionview")), selection->regions), event, _cursors->fade_in);
 				return true;
 			}
 
 			case FadeOutHandleItem:
 			{
-				RegionSelection s = get_equivalent_regions (selection->regions, Properties::select.property_id);
-				_drags->set (new FadeOutDrag (this, item, reinterpret_cast<RegionView*> (item->get_data("regionview")), s), event, _cursors->fade_out);
+				_drags->set (new FadeOutDrag (this, item, reinterpret_cast<RegionView*> (item->get_data("regionview")), selection->regions), event, _cursors->fade_out);
 				return true;
 			}
 
@@ -951,8 +948,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
 			case EndCrossFadeItem:
 				/* we might allow user to grab inside the fade to trim a region with preserve_fade_anchor.  for not this is not fully implemented */ 
 //				if (!clicked_regionview->region()->locked()) {
-//					RegionSelection s = get_equivalent_regions (selection->regions, Properties::edit.property_id);
-//					_drags->set (new TrimDrag (this, item, clicked_regionview, s.by_layer(), true), event);
+//					_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), true), event);
 //					return true;
 //				}
 				break;
@@ -1002,8 +998,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
 			case LeftFrameHandle:
                         case RightFrameHandle:
 				if (!clicked_regionview->region()->locked()) {
-					RegionSelection s = get_equivalent_regions (selection->regions, Properties::select.property_id);
-					_drags->set (new TrimDrag (this, item, clicked_regionview, s.by_layer()), event);
+					_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer()), event);
 					return true;
 				}
 				break;
@@ -1011,8 +1006,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
 			case RegionViewName:
 			{
 				/* rename happens on edit clicks */
-				RegionSelection s = get_equivalent_regions (selection->regions, Properties::select.property_id);
-				_drags->set (new TrimDrag (this, clicked_regionview->get_name_highlight(), clicked_regionview, s.by_layer()), event);
+				_drags->set (new TrimDrag (this, clicked_regionview->get_name_highlight(), clicked_regionview, selection->regions.by_layer()), event);
 				return true;
 				break;
 			}
@@ -2598,8 +2592,7 @@ Editor::add_region_drag (ArdourCanvas::Item* item, GdkEvent*, RegionView* region
 	if (Config->get_edit_mode() == Splice) {
 		_drags->add (new RegionSpliceDrag (this, item, region_view, selection->regions.by_layer()));
 	} else {
-		RegionSelection s = get_equivalent_regions (selection->regions, ARDOUR::Properties::select.property_id);
-		_drags->add (new RegionMoveDrag (this, item, region_view, s.by_layer(), false, false));
+		_drags->add (new RegionMoveDrag (this, item, region_view, selection->regions.by_layer(), false, false));
 	}
 
 	/* sync the canvas to what we think is its current state */
@@ -2617,8 +2610,7 @@ Editor::add_region_copy_drag (ArdourCanvas::Item* item, GdkEvent*, RegionView* r
 
 	_region_motion_group->raise_to_top ();
 
-	RegionSelection s = get_equivalent_regions (selection->regions, ARDOUR::Properties::select.property_id);
-	_drags->add (new RegionMoveDrag (this, item, region_view, s.by_layer(), false, true));
+	_drags->add (new RegionMoveDrag (this, item, region_view, selection->regions.by_layer(), false, true));
 }
 
 void
@@ -2634,8 +2626,7 @@ Editor::add_region_brush_drag (ArdourCanvas::Item* item, GdkEvent*, RegionView*
 		return;
 	}
 
-	RegionSelection s = get_equivalent_regions (selection->regions, ARDOUR::Properties::select.property_id);
-	_drags->add (new RegionMoveDrag (this, item, region_view, s.by_layer(), true, false));
+	_drags->add (new RegionMoveDrag (this, item, region_view, selection->regions.by_layer(), true, false));
 
 	begin_reversible_command (Operations::drag_region_brush);
 }
5515.patch (5,117 bytes)   

paul

2013-06-10 16:09

administrator   ~0014962

You described behaviour sounds right to me, as long as there is a check for an existing selection.

colinf

2013-06-10 16:34

updater   ~0014969

Editor::set_selected_regionview_from_click() in gtk2_ardour/editor_selection.cc (around line 637 onwards) already does the right thing: the selection is replaced by the equivalent regions only if the clicked regionview is not already selected, so it seems the change above is all that's needed.

I'll push it forthwith.

colinf

2013-06-10 17:10

updater   ~0014972

Fix now pushed.

colinf

2015-09-18 15:29

updater   ~0017314

Closing old issues reported by me: these have long since been fixed.

Issue History

Date Modified Username Field Change
2013-06-07 08:34 colinf New Issue
2013-06-07 09:14 colinf File Added: 5515.patch
2013-06-10 16:09 paul Note Added: 0014962
2013-06-10 16:34 colinf Note Added: 0014969
2013-06-10 17:10 colinf Note Added: 0014972
2013-06-10 17:10 colinf Status new => resolved
2013-06-10 17:10 colinf Resolution open => fixed
2013-06-10 17:10 colinf Assigned To => colinf
2015-09-18 15:29 colinf Note Added: 0017314
2015-09-18 15:29 colinf Status resolved => closed