13
0

ArdourDialog: API to prevent idle callbacks during response handling

This commit is contained in:
Paul Davis 2022-12-12 10:15:55 -07:00
parent 62bfd34ba8
commit 095b84080a
2 changed files with 11 additions and 1 deletions

View File

@ -42,6 +42,7 @@ ArdourDialog::ArdourDialog (const string& title, bool modal, bool use_seperator)
, _sensitive (true)
, proxy (nullptr)
, _splash_pushed (false)
, allow_idle (true)
{
init ();
set_position (Gtk::WIN_POS_MOUSE);
@ -52,6 +53,7 @@ ArdourDialog::ArdourDialog (Gtk::Window& parent, const string& title, bool modal
, _sensitive (true)
, proxy (nullptr)
, _splash_pushed (false)
, allow_idle (true)
{
init ();
set_position (Gtk::WIN_POS_CENTER_ON_PARENT);
@ -63,6 +65,10 @@ ArdourDialog::~ArdourDialog ()
Keyboard::the_keyboard ().focus_out_window (nullptr, this);
WM::Manager::instance ().remove (proxy);
proxy->explicit_delete ();
void
ArdourDialog::disallow_idle ()
{
allow_idle = false;
}
void
@ -70,7 +76,9 @@ ArdourDialog::on_response (int response_id)
{
pop_splash ();
hide ();
ARDOUR::GUIIdle ();
if (allow_idle) {
ARDOUR::GUIIdle ();
}
Gtk::Dialog::on_response (response_id);
}

View File

@ -51,6 +51,7 @@ public:
void on_show ();
virtual void on_response (int);
void set_ui_sensitive (bool);
void disallow_idle ();
protected:
void pop_splash ();
@ -61,6 +62,7 @@ private:
WM::ProxyTemporary* proxy;
bool _splash_pushed;
void init ();
bool allow_idle;
static sigc::signal<void> CloseAllDialogs;
};