diff --git a/gtk2_ardour/progress_dialog.cc b/gtk2_ardour/progress_dialog.cc index 0cee9878e7..af3f86251c 100644 --- a/gtk2_ardour/progress_dialog.cc +++ b/gtk2_ardour/progress_dialog.cc @@ -129,20 +129,36 @@ ProgressDialog::add_progress_step () void ProgressDialog::show_pd () { - WavesDialog::show (); + Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&ProgressDialog::show_pd_in_gui_thread , this)); +} + +void +ProgressDialog::show_pd_in_gui_thread () +{ + WavesDialog::show (); /* Make sure the progress dialog is drawn */ - Glib::MainContext::get_default()->iteration (false); + while (Glib::MainContext::get_default()->iteration (false)) { + /* do nothing */ + } } void ProgressDialog::hide_pd () { - Glib::MainContext::get_default()->iteration (false); + Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&ProgressDialog::hide_pd_in_gui_thread , this)); +} +void +ProgressDialog::hide_pd_in_gui_thread () +{ + while (Glib::MainContext::get_default()->iteration (false)) { + /* do nothing */ + } set_progress (0); WavesDialog::hide (); } + void ProgressDialog::show_cancel_button () { diff --git a/gtk2_ardour/progress_dialog.h b/gtk2_ardour/progress_dialog.h index df2c8e14cc..bf2144a421 100644 --- a/gtk2_ardour/progress_dialog.h +++ b/gtk2_ardour/progress_dialog.h @@ -58,6 +58,8 @@ private: const std::string& top_message, const std::string& progress_message, const std::string& bottom_message); + void show_pd_in_gui_thread (); + void hide_pd_in_gui_thread (); void set_progress_in_gui_thread (float); Gtk::Label& _top_label; Gtk::Label& _bottom_label;