Fix update of follow-playhead state to fix mantis bug 1599
authorCarl Hetherington <carl@carlh.net>
Fri, 20 Apr 2007 16:34:38 +0000 (16:34 +0000)
committerCarl Hetherington <carl@carlh.net>
Fri, 20 Apr 2007 16:34:38 +0000 (16:34 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1735 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.cc

index 7c05ce8165a8f6963d3098a455078703b1ed8614..736510fdc661319c4e4e984a726a49c09ed84255 100644 (file)
@@ -2104,16 +2104,16 @@ Editor::set_state (const XMLNode& node)
 
        if ((prop = node.property ("follow-playhead"))) {
                bool yn = (prop->value() == "yes");
+               set_follow_playhead (yn);
                RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-follow-playhead"));
                if (act) {
                        RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
-                       /* do it twice to force the change */
-                       tact->set_active (!yn);
-                       tact->set_active (yn);
+                       if (tact->get_active() != yn) {
+                               tact->set_active (yn);
+                       }
                }
        }
 
-
        if ((prop = node.property ("region-list-sort-type"))) {
                region_list_sort_type = (Editing::RegionListSortType) -1; // force change 
                reset_region_list_sort_type(str2regionlistsorttype(prop->value()));