summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2015-04-14 11:18:50 +0100
committerJohn Emmas <johne53@tiscali.co.uk>2015-04-14 11:22:14 +0100
commit15bf19961f743d03581d0dee15858444e775df82 (patch)
tree015e8a76d96a3d0070beda0668b7aaf269ebd7ca
parent2d8aa1d2fff149223d7e30ba23d73e6da4738f8c (diff)
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... :)
-rw-r--r--gtk2_ardour/engine_dialog.cc20
1 files changed, 20 insertions, 0 deletions
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;