diff options
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r-- | gtk2_ardour/editor.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 9d1938c2d2..7b5685858d 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1169,6 +1169,10 @@ Editor::center_screen_internal (nframes64_t frame, float page) void Editor::handle_new_duration () { + if (!session) { + return; + } + ENSURE_GUI_THREAD (mem_fun (*this, &Editor::handle_new_duration)); nframes64_t new_end = session->get_maximum_extent() + (nframes64_t) floorf (current_page_frames() * 0.10f); @@ -1176,6 +1180,7 @@ Editor::handle_new_duration () if (new_end > last_canvas_frame) { last_canvas_frame = new_end; horizontal_adjustment.set_upper (last_canvas_frame / frames_per_unit); + horizontal_adjustment.set_page_size (current_page_frames()/frames_per_unit); //reset_scrolling_region (); } @@ -1324,6 +1329,7 @@ Editor::connect_to_session (Session *t) sfbrowser->set_session (session); } + last_canvas_frame = 0; // force update in handle_new_duration() handle_new_duration (); redisplay_regions (); |