When running on Windows, hide the Engine dialog before calling 'push_state_to_backend()'

For some reason we don't understand 'push_state_to_backend()' can interfere with hiding the dialog (causing a partially hidden dialog to remain on screen). It's most likely a timing issue with the Windows version of GTK. Fortunately, reversing the calling order seems to fix it - BUT...

If there's no session loaded yet, the user can be left with a very long wait while nothing seems to be happening. The next thing the user would normally see would be the splash image. So let's display it slightly early (so the user can at least see that something's happening).

Sadly, it's all very kludgy - but a lot better than what we had before...  :)
This commit is contained in:
John Emmas 2015-04-14 11:18:50 +01:00
parent 2d8aa1d2ff
commit 15bf19961f

View File

@ -48,6 +48,7 @@
#include "pbd/convert.h"
#include "pbd/error.h"
#include "opts.h"
#include "ardour_ui.h"
#include "engine_dialog.h"
#include "gui_thread.h"
@ -342,9 +343,28 @@ EngineControl::on_response (int response_id)
push_state_to_backend (true);
break;
case RESPONSE_OK:
#ifdef PLATFORM_WINDOWS
// For some reason we don't understand, 'hide()'
// needs to get called first in Windows
hide ();
// But if there's no session open, this can produce
// a long gap when nothing appears to be happening.
// Let's show the splash image while we're waiting.
if ( !ARDOUR_COMMAND_LINE::no_splash ) {
if ( ARDOUR_UI::instance() ) {
if ( !ARDOUR_UI::instance()->session_loaded ) {
ARDOUR_UI::instance()->show_splash();
}
}
}
push_state_to_backend (true);
break;
#else
push_state_to_backend (true);
hide ();
break;
#endif
case RESPONSE_DELETE_EVENT:
{
GdkEventButton ev;