From fc5d97edc27e88bbc349e5a6060f583474d0dcfe Mon Sep 17 00:00:00 2001 From: GZharun Date: Wed, 17 Dec 2014 18:31:57 +0200 Subject: [PATCH] [Summary] Fixed bug 44136. Region was not selected after paste operation --- gtk2_ardour/editor_ops.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index f0aff35560..80e3926b3c 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -4492,10 +4492,24 @@ Editor::paste_internal (framepos_t position, float times) begin_reversible_command (Operations::paste); + RegionSelection new_regions; + for (nth = 0, i = ts.begin(); i != ts.end(); ++i, ++nth) { + + RouteTimeAxisView* route_view = dynamic_cast (*i); + + // connect this collect_new_region_view method to RegionViewAdded signal + // to collect newly pasted regions in latest_regionviews container + sigc::connection c = route_view->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view)); + (*i)->paste (position, times, *cut_buffer, nth); + + c.disconnect (); + new_regions.add(latest_regionviews); } + selection->set (new_regions); + commit_reversible_command (); } }