From 15bf19961f743d03581d0dee15858444e775df82 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Tue, 14 Apr 2015 11:18:50 +0100 Subject: [PATCH] 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... :) --- gtk2_ardour/engine_dialog.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index c88c836dfe..7a9431a544 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -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;