Use add_route_dialog's transient_for() window to determine track selection for order_hint.
This commit is contained in:
parent
a18db90264
commit
e80d66c908
@ -3231,19 +3231,20 @@ ARDOUR_UI::setup_order_hint ()
|
|||||||
we want the new routes to have their order keys set starting from
|
we want the new routes to have their order keys set starting from
|
||||||
the highest order key in the selection + 1 (if available).
|
the highest order key in the selection + 1 (if available).
|
||||||
*/
|
*/
|
||||||
|
if (add_route_dialog->get_transient_for () == mixer->get_toplevel()) {
|
||||||
for (RouteUISelection::iterator s = mixer->selection().routes.begin(); s != mixer->selection().routes.end(); ++s) {
|
for (RouteUISelection::iterator s = mixer->selection().routes.begin(); s != mixer->selection().routes.end(); ++s) {
|
||||||
if ((*s)->route()->order_key() > order_hint) {
|
if ((*s)->route()->order_key() > order_hint) {
|
||||||
order_hint = (*s)->route()->order_key();
|
order_hint = (*s)->route()->order_key();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
for (TrackSelection::iterator s = editor->get_selection().tracks.begin(); s != editor->get_selection().tracks.end(); ++s) {
|
for (TrackSelection::iterator s = editor->get_selection().tracks.begin(); s != editor->get_selection().tracks.end(); ++s) {
|
||||||
RouteTimeAxisView* tav = dynamic_cast<RouteTimeAxisView*> (*s);
|
RouteTimeAxisView* tav = dynamic_cast<RouteTimeAxisView*> (*s);
|
||||||
if (tav->route()->order_key() > order_hint) {
|
if (tav->route()->order_key() > order_hint) {
|
||||||
order_hint = tav->route()->order_key();
|
order_hint = tav->route()->order_key();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!mixer->selection().routes.empty() || !editor->get_selection().tracks.empty()) {
|
if (!mixer->selection().routes.empty() || !editor->get_selection().tracks.empty()) {
|
||||||
order_hint++;
|
order_hint++;
|
||||||
@ -3282,6 +3283,7 @@ ARDOUR_UI::add_route (Gtk::Window* float_window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (float_window) {
|
if (float_window) {
|
||||||
|
add_route_dialog->unset_transient_for ();
|
||||||
add_route_dialog->set_transient_for (*float_window);
|
add_route_dialog->set_transient_for (*float_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user