13
0

fix SNAFU with ordering of adding stripables and selecting them

when Session emits RouteAdded, each handler (editor, mixer, trigger pages etc) will
execute their callbacks in order. But Editor::add_routes() selects the routes too,
which triggers a PresentationInfo::Change signal. This is received by e.g. the Mixer
before it has even found out about the newly added stripables. This in turn
leads to severe confusion regarding the state of the selection in the mixer,
and potentially elsewhere.

So, just add a PresentationInfo::ChangeSuspender for the scope of the RouteAdde
signal emission
This commit is contained in:
Paul Davis 2023-10-05 12:57:16 -06:00
parent cd1d83f366
commit eba00287cd

View File

@ -3256,6 +3256,11 @@ Session::add_routes (RouteList& new_routes, bool input_auto_connect, bool output
update_route_record_state (); update_route_record_state ();
/* Nobody should hear about changes to PresentationInfo
* (e.g. selection) until all handlers of RouteAdded have executed
*/
PresentationInfo::ChangeSuspender cs;
RouteAdded (new_routes); /* EMIT SIGNAL */ RouteAdded (new_routes); /* EMIT SIGNAL */
} }