Fix for segfault on autoscroll (especially when dragging regions).
[ardour.git] / gtk2_ardour / editor.cc
index 9ab8efb742ba7cb45f2ad634f430c54b4a5221db..ecf3870c7ffe43ddb34ef7155f754f3499f85151 100644 (file)
@@ -132,8 +132,8 @@ static const gchar *zoom_focus_strings[] = {
        N_("Focus Left"),
        N_("Focus Right"),
        N_("Focus Center"),
-       N_("Focus Play"),
-       N_("Focus Edit"),
+       N_("Focus Playhead"),
+       N_("Focus Edit Cursor"),
        0
 };
 
@@ -248,6 +248,7 @@ Editor::Editor (AudioEngine& eng)
        bbt_beat_subdivision = 4;
        canvas_width = 0;
        canvas_height = 0;
+       autoscroll_active = false;
        autoscroll_timeout_tag = -1;
        interthread_progress_window = 0;
 
@@ -801,8 +802,8 @@ Editor::set_frames_per_unit (double fpu)
                return;
        }
 
-       if (fpu < 1.0) {
-               fpu = 1.0;
+       if (fpu < 2.0) {
+               fpu = 2.0;
        }
 
        // convert fpu to frame count
@@ -817,6 +818,10 @@ Editor::set_frames_per_unit (double fpu)
                return;
        }
 
+       if (fpu == frames_per_unit) {
+               return;
+       }
+
        frames_per_unit = fpu;
 
        if (frames != zoom_range_clock.current_duration()) {
@@ -2162,7 +2167,7 @@ Editor::get_state ()
        XMLNode* node = new XMLNode ("Editor");
        char buf[32];
 
-       _id.print (buf);
+       _id.print (buf, sizeof (buf));
        node->add_property ("id", buf);
        
        if (is_realized()) {