+ if (!latest_regionviews.empty()) {
+ // XXX why just the first one ? we only expect one
+ // commented out in nick_m's canvas reworking. is that intended?
+ //dest_atv->reveal_dependent_views (*latest_regionviews.front());
+ new_selection.push_back (latest_regionviews.front());
+ }
+
+ } else {
+ /*
+ motion on the same track. plonk the previously reparented region
+ back to its original canvas group (its streamview).
+ No need to do anything for copies as they are fake regions which will be deleted.
+ */
+
+ rv->get_canvas_group()->reparent (*dest_rtv->view()->canvas_item());
+ rv->get_canvas_group()->property_y() = 0;
+
+ /* just change the model */
+
+ boost::shared_ptr<Playlist> playlist = dest_rtv->playlist();
+
+ insert_result = modified_playlists.insert (playlist);
+ if (insert_result.second) {
+ session->add_command (new MementoCommand<Playlist>(*playlist, &playlist->get_state(), 0));
+ }
+ /* freeze to avoid lots of relayering in the case of a multi-region drag */
+ frozen_insert_result = frozen_playlists.insert(playlist);
+ if (frozen_insert_result.second) {
+ playlist->freeze();
+ }
+
+ rv->region()->set_position (where, (void*) this);
+ }
+
+ if (changed_tracks && !drag_info.copy) {
+
+ /* get the playlist where this drag started. we can't use rv->region()->playlist()
+ because we may have copied the region and it has not been attached to a playlist.
+ */
+
+ assert ((source_tv = dynamic_cast<RouteTimeAxisView*> (&rv->get_time_axis_view())));
+ assert ((ds = source_tv->get_diskstream()));
+ assert ((from_playlist = ds->playlist()));
+
+ /* moved to a different audio track, without copying */
+
+ /* the region that used to be in the old playlist is not
+ moved to the new one - we use a copy of it. as a result,
+ any existing editor for the region should no longer be
+ visible.
+ */
+
+ rv->hide_region_editor();
+ rv->fake_set_opaque (false);
+
+ /* remove the region from the old playlist */
+
+ insert_result = modified_playlists.insert (from_playlist);
+ if (insert_result.second) {
+ session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0));