make undo/redo work for Regions > Edit > Close Gaps
[ardour.git] / gtk2_ardour / engine_dialog.cc
index 63883eb7c9a57481536d4db0c00a83d605f58f19..4dc806763fcea6751f0bffddd5a9d6981a625eaf 100644 (file)
 #include "ardour_ui.h"
 #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"
 
 using namespace std;
 using namespace Gtk;
@@ -413,6 +416,9 @@ void
 EngineControl::on_show ()
 {
        ArdourDialog::on_show ();
+       if (Splash::instance()) {
+               Splash::instance()->hide ();
+       }
        if (!ARDOUR::AudioEngine::instance()->current_backend() || !ARDOUR::AudioEngine::instance()->running()) {
                // re-check _have_control (jackd running) see #6041
                backend_changed ();
@@ -421,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 ()
 {
@@ -2712,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 ();
+                       }
                }
        }
 }
@@ -3125,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 ();
+                       }
                }
        }
 }