13
0

Don't hide Audio Setup dialog when clicking 'OK' if engine fails to start

This has to be handled in two places, in ARDOUR_UI::do_audio_midi_setup and in
the dialogs response handler and in as the window can also be triggered via the
window action manager.
This commit is contained in:
Tim Mayberry 2015-09-26 20:22:46 +10:00
parent 2768ce9b05
commit 463bd470e8
2 changed files with 21 additions and 16 deletions

View File

@ -4828,15 +4828,23 @@ ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate)
audio_midi_setup->set_desired_sample_rate (desired_sample_rate);
audio_midi_setup->set_position (WIN_POS_CENTER);
switch (audio_midi_setup->run()) {
int response;
while (true) {
response = audio_midi_setup->run();
switch (response) {
case Gtk::RESPONSE_OK:
if (!AudioEngine::instance()->running()) {
continue;
} else {
return 0;
case Gtk::RESPONSE_APPLY:
}
return 0;
default:
return -1;
}
}
}
gint

View File

@ -415,10 +415,12 @@ EngineControl::on_response (int response_id)
switch (response_id) {
case RESPONSE_OK:
#ifdef PLATFORM_WINDOWS
// For some reason we don't understand, 'hide()'
// needs to get called first in Windows
if (push_state_to_backend (true) != 0) {
return;
} else {
hide ();
}
#ifdef PLATFORM_WINDOWS
// But if there's no session open, this can produce
// a long gap when nothing appears to be happening.
@ -430,13 +432,8 @@ EngineControl::on_response (int response_id)
}
}
}
push_state_to_backend (true);
break;
#else
push_state_to_backend (true);
hide ();
break;
#endif
break;
case RESPONSE_DELETE_EVENT:
{
GdkEventButton ev;