From 4a3413f2d46cd948d5c11ba2010f22f55d2eb55f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 30 Oct 2015 15:54:54 +0100 Subject: [PATCH] suspend timers while flushing the gtk-event queue. This fixes an issues where Ardour never completes to flush the GUI event queue due to rapid updates for meters and similar events. ARDOUR_UI::load_session() never returned and the complete session ran inside Gtkmm2ext::UI::flush_pending(), this later causes a crash at exit. as side effect, this also speeds up session load. --- gtk2_ardour/ardour_ui.cc | 5 ++++- gtk2_ardour/editor.cc | 1 + gtk2_ardour/editor_ops.cc | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 1291023f1b..15106d79ef 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -3204,7 +3204,10 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name, fst_stop_threading(); #endif - flush_pending (); + { + Timers::TimerSuspender t; + flush_pending (); + } #ifdef WINDOWS_VST_SUPPORT fst_start_threading(); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index c9bdb12c4e..4a559167e8 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -5074,6 +5074,7 @@ Editor::first_idle () MessageDialog* dialog = 0; if (track_views.size() > 1) { + Timers::TimerSuspender t; dialog = new MessageDialog ( *this, string_compose (_("Please wait while %1 loads visual data."), PROGRAM_NAME), diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 4b00d22b28..6c48fa4e4f 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -96,6 +96,7 @@ #include "streamview.h" #include "strip_silence_dialog.h" #include "time_axis_view.h" +#include "timers.h" #include "transpose_dialog.h" #include "transform_dialog.h" #include "ui_config.h" @@ -7887,6 +7888,7 @@ Editor::bring_in_callback (Gtk::Label* label, uint32_t n, uint32_t total, string void Editor::update_bring_in_message (Gtk::Label* label, uint32_t n, uint32_t total, string name) { + Timers::TimerSuspender t; label->set_text (string_compose ("Copying %1, %2 of %3", name, n, total)); Gtkmm2ext::UI::instance()->flush_pending (); } @@ -7907,6 +7909,7 @@ Editor::bring_all_sources_into_session () * files */ + Timers::TimerSuspender t; Gtkmm2ext::UI::instance()->flush_pending (); cerr << " Do it\n";