ipw: Fix race condition with polling the cancel state of the dialog

Sometimes the interthread process window dialog reports "cancelled"
when it was not actually cancelled, it was just hidden and reshown,
Since we are polling the cancel state interthread, we must reset
the cancel status BEFORE the dialog is shown, and never toggle the
cancel state unless it is a true cancel action by the user.
This commit is contained in:
Damien Zammit 2018-09-29 14:18:10 +10:00
parent feb2763a8a
commit a9907b7d56
1 changed files with 2 additions and 2 deletions

View File

@ -35,6 +35,8 @@ InterthreadProgressWindow::InterthreadProgressWindow (ARDOUR::InterThreadInfo* i
: ArdourDialog (t, true)
, _interthread_info (i)
{
_interthread_info->cancel = false;
_bar.set_orientation (Gtk::PROGRESS_LEFT_TO_RIGHT);
set_border_width (12);
@ -50,8 +52,6 @@ InterthreadProgressWindow::InterthreadProgressWindow (ARDOUR::InterThreadInfo* i
set_default_size (200, 100);
show_all ();
hide ();
_interthread_info->cancel = false; // override on_hide
Glib::signal_timeout().connect (sigc::mem_fun (*this, &InterthreadProgressWindow::update), 100);
}