avoid doing needless duplicate work in Selection::add (TimeAxisView*)
[ardour.git] / gtk2_ardour / engine_dialog.cc
index 1bc6f4968b219853a0c65583806db052f844a102..4dc806763fcea6751f0bffddd5a9d6981a625eaf 100644 (file)
@@ -53,6 +53,7 @@
 #include "engine_dialog.h"
 #include "gui_thread.h"
 #include "ui_config.h"
+#include "public_editor.h"
 #include "utils.h"
 #include "pbd/i18n.h"
 #include "splash.h"
@@ -114,12 +115,6 @@ EngineControl::EngineControl ()
 
        set_name (X_("AudioMIDISetup"));
 
-       if (UIConfiguration::instance().get_all_floating_windows_are_dialogs()) {
-               set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
-       } else {
-               set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY);
-       }
-
        /* the backend combo is the one thing that is ALWAYS visible */
 
        vector<const ARDOUR::AudioBackendInfo*> backends = ARDOUR::AudioEngine::instance()->available_backends();
@@ -422,7 +417,7 @@ EngineControl::on_show ()
 {
        ArdourDialog::on_show ();
        if (Splash::instance()) {
-               Splash::instance()->pop_back_for (*this);
+               Splash::instance()->hide ();
        }
        if (!ARDOUR::AudioEngine::instance()->current_backend() || !ARDOUR::AudioEngine::instance()->running()) {
                // re-check _have_control (jackd running) see #6041
@@ -432,6 +427,19 @@ EngineControl::on_show ()
        start_stop_button.grab_focus();
 }
 
+void
+EngineControl::on_map ()
+{
+       if (!ARDOUR_UI::instance()->session_loaded && !PublicEditor::_instance) {
+               set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL);
+       } else if (UIConfiguration::instance().get_all_floating_windows_are_dialogs()) {
+               set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
+       } else {
+               set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY);
+       }
+       ArdourDialog::on_map ();
+}
+
 bool
 EngineControl::try_autostart ()
 {
@@ -2723,6 +2731,9 @@ EngineControl::start_stop_button_clicked ()
                start_engine ();
                if (!ARDOUR_UI::instance()->session_loaded) {
                        ArdourDialog::on_response (RESPONSE_OK);
+                       if (Splash::instance()) {
+                               Splash::instance()->pop_front ();
+                       }
                }
        }
 }
@@ -3136,6 +3147,9 @@ EngineControl::connect_disconnect_click()
                start_engine ();
                if (!ARDOUR_UI::instance()->session_loaded) {
                        ArdourDialog::on_response (RESPONSE_OK);
+                       if (Splash::instance()) {
+                               Splash::instance()->pop_front ();
+                       }
                }
        }
 }