X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fardour_dialog.cc;h=c7d78099ce1e3cae34354e03f7308c15d939ad25;hb=1e97c09eed646adb030fd198d9ced9530bae20cb;hp=b5a5f52b67392db96570a24ef1a9f277367de83b;hpb=ced4378d0914bcfb926267772c45d1d23f3bed38;p=ardour.git diff --git a/gtk2_ardour/ardour_dialog.cc b/gtk2_ardour/ardour_dialog.cc index b5a5f52b67..c7d78099ce 100644 --- a/gtk2_ardour/ardour_dialog.cc +++ b/gtk2_ardour/ardour_dialog.cc @@ -37,15 +37,15 @@ using namespace ARDOUR_UI_UTILS; ArdourDialog::ArdourDialog (string title, bool modal, bool use_seperator) : Dialog (title, modal, use_seperator) , proxy (0) - , _splash_pushed (false) + , _splash_pushed (false) { init (); - set_position (Gtk::WIN_POS_CENTER); + set_position (Gtk::WIN_POS_MOUSE); } ArdourDialog::ArdourDialog (Gtk::Window& parent, string title, bool modal, bool use_seperator) : Dialog (title, parent, modal, use_seperator) - , _splash_pushed (false) + , _splash_pushed (false) { init (); set_position (Gtk::WIN_POS_CENTER_ON_PARENT); @@ -53,16 +53,33 @@ ArdourDialog::ArdourDialog (Gtk::Window& parent, string title, bool modal, bool ArdourDialog::~ArdourDialog () { - if (_splash_pushed) { - Splash* spl = Splash::instance(); - - if (spl) { - spl->pop_front(); - } - } + pop_splash (); + Keyboard::the_keyboard().focus_out_window (0, this); WM::Manager::instance().remove (proxy); } +void +ArdourDialog::on_response (int response_id) +{ + pop_splash (); + hide (); + ARDOUR::GUIIdle (); + Gtk::Dialog::on_response (response_id); +} + +void +ArdourDialog::pop_splash () +{ + if (_splash_pushed) { + Splash* spl = Splash::instance(); + + if (spl) { + spl->pop_front(); + } + _splash_pushed = false; + } +} + bool ArdourDialog::on_focus_in_event (GdkEventFocus *ev) { @@ -97,7 +114,7 @@ ArdourDialog::on_show () if (spl && spl->is_visible()) { spl->pop_back_for (*this); - _splash_pushed = true; + _splash_pushed = true; } }