From ca88794ab7cb775d900a843f79b83c64338e0f69 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 12 May 2023 03:34:47 +0200 Subject: [PATCH] Engine-dialog: push splash on error When starting the engine fails, the splash screen needs to remain behind the dialog. --- gtk2_ardour/engine_dialog.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index e37efb16e2..45af3c5d4f 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -2679,7 +2679,9 @@ EngineControl::on_response (int r) * StartupFSM does hide us after response(); Window > Audio/MIDI Setup * does not. */ - pop_splash (); + if (r == RESPONSE_OK) { + pop_splash (); + } Gtk::Dialog::on_response (r); } @@ -2696,16 +2698,18 @@ EngineControl::start_stop_button_clicked () return; } + int rv = RESPONSE_OK; + if (ARDOUR::AudioEngine::instance ()->running ()) { ARDOUR::AudioEngine::instance ()->stop (); } else { /* whoever displayed this dialog is expected to do its own check on whether or not the engine is running. */ - start_engine (); + rv = start_engine () ? RESPONSE_OK : RESPONSE_ACCEPT; } - response (RESPONSE_OK); + response (rv); } void