diff --git a/gtk2_ardour/editor_sections.cc b/gtk2_ardour/editor_sections.cc index 55f01551a2..636dacdf76 100644 --- a/gtk2_ardour/editor_sections.cc +++ b/gtk2_ardour/editor_sections.cc @@ -102,7 +102,7 @@ EditorSections::set_session (Session* s) Location::start_changed.connect (_session_connections, invalidator (*this), boost::bind (&EditorSections::location_changed, this, _1), gui_context ()); Location::end_changed.connect (_session_connections, invalidator (*this), boost::bind (&EditorSections::location_changed, this, _1), gui_context ()); - Location::flags_changed.connect (_session_connections, invalidator (*this), boost::bind (&EditorSections::redisplay, this), gui_context ()); + Location::flags_changed.connect (_session_connections, invalidator (*this), boost::bind (&EditorSections::queue_redisplay, this), gui_context ()); Location::name_changed.connect (_session_connections, invalidator (*this), boost::bind (&EditorSections::location_changed, this, _1), gui_context ()); } @@ -122,10 +122,25 @@ void EditorSections::location_changed (ARDOUR::Location* l) { if (l->is_section ()) { - redisplay (); + queue_redisplay (); } } +void +EditorSections::queue_redisplay () +{ + if (!_redisplay_connection.connected ()) { + _redisplay_connection = Glib::signal_idle().connect (sigc::mem_fun (*this, &EditorSections::idle_redisplay), Glib::PRIORITY_HIGH_IDLE+10); + } +} + +bool +EditorSections::idle_redisplay () +{ + redisplay (); + return false; +} + void EditorSections::redisplay () { diff --git a/gtk2_ardour/editor_sections.h b/gtk2_ardour/editor_sections.h index f726c7e38e..46c39f37ed 100644 --- a/gtk2_ardour/editor_sections.h +++ b/gtk2_ardour/editor_sections.h @@ -45,6 +45,8 @@ public: private: void redisplay (); + void queue_redisplay (); + bool idle_redisplay (); void location_changed (ARDOUR::Location*); bool delete_selected_section (); bool rename_selected_section (); @@ -117,6 +119,7 @@ private: bool _no_redisplay; sigc::connection _scroll_timeout; sigc::connection _selection_change; + sigc::connection _redisplay_connection; }; #endif