From 935ee63ed3aeb9dcfae0286b5e54c03f660dd2af Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 24 Sep 2014 15:50:59 -0400 Subject: [PATCH] make unmodified drag on a range/time selection do a separate first, then drag the new region. This behaviour is only superficially similar to Logic's behaviour. It also operates only on the FIRST selected range's new region (the one created by the separate), rather than all of them. Extending it to operate on all ranges (across tracks) is theoretically possible but has some complications that go beyond this simple change. Dragging the selection itself now occurs on Primary-drag. --- gtk2_ardour/editor_mouse.cc | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index faa6cb26b7..53bf960faf 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -748,27 +748,27 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT break; case SelectionItem: - if (Keyboard::modifier_state_contains (event->button.state, Keyboard::ModifierMask(Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) { - start_selection_grab (item, event); - return true; - } else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::SecondaryModifier)) { + if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) { /* grab selection for moving */ _drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionMove), event); } else { double const y = event->button.y; - pair tvp = trackview_by_y_position (y); - if (tvp.first) { + pair tvp = trackview_by_y_position (y); + if (tvp.first) { AutomationTimeAxisView* atv = dynamic_cast (tvp.first); - if ( get_smart_mode() && atv) { + if (get_smart_mode() && atv) { /* smart "join" mode: drag automation */ _drags->set (new AutomationRangeDrag (this, atv, selection->time), event, _cursors->up_down); } else { /* this was debated, but decided the more common action was to - make a new selection */ - _drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event); - } - } - } + separate-drag the selection. Well actually, Igor@Waves + decided this, so here it is. + */ + start_selection_grab (item, event); + return true; + } + } + } break; case StreamItem: @@ -2442,7 +2442,6 @@ Editor::start_selection_grab (ArdourCanvas::Item* /*item*/, GdkEvent* event) } /* XXX fix me one day to use all new regions */ - boost::shared_ptr region (new_regions.front()); /* add it to the current stream/playlist.