diff options
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 3 | ||||
-rw-r--r-- | gtk2_ardour/editor_mixer.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 2 |
4 files changed, 25 insertions, 1 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 719ac2a266..c7cdd1aa3c 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -248,7 +248,8 @@ Editor::Editor () /* nudge */ nudge_clock (X_("nudge"), false, X_("NudgeClock"), true, true), - meters_running(false) + meters_running(false), + _pending_locate_request (false) { constructed = false; @@ -1280,6 +1281,8 @@ Editor::connect_to_session (Session *t) session_connections.push_back (session->tempo_map().StateChanged.connect (mem_fun(*this, &Editor::tempo_map_changed))); + session_connections.push_back (session->Located.connect (mem_fun (*this, &Editor::located))); + edit_groups_changed (); edit_point_clock.set_mode(AudioClock::BBT); @@ -5346,3 +5349,11 @@ Editor::idle_resize () resize_idle_id = -1; return false; } + +void +Editor::located () +{ + ENSURE_GUI_THREAD (mem_fun (*this, &Editor::located)); + + _pending_locate_request = false; +} diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index f0e28677f7..420dc3c457 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -2376,6 +2376,9 @@ public: void visible_order_range (int*, int*) const; bool y_movement_disallowed (int, int, int, int, int, std::bitset<512> const &, std::vector<int32_t> const &) const; + + void located (); + bool _pending_locate_request; }; #endif /* __ardour_editor_h__ */ diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index 618d59455e..04caa99f28 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -232,6 +232,14 @@ double current = 0.0; void Editor::update_current_screen () { + if (_pending_locate_request) { + /* we don't update things when there's a pending locate request, otherwise + when the editor requests a locate there is a chance that this method + will move the playhead before the locate request is processed, causing + a visual glitch. */ + return; + } + if (session && session->engine().running()) { nframes64_t const frame = session->audible_frame(); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 157bda3f79..49c067746d 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -2429,6 +2429,7 @@ Editor::cursor_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event if (item == &playhead_cursor->canvas_item) { if (session) { session->request_locate (playhead_cursor->current_frame, drag_info.was_rolling); + _pending_locate_request = true; } } } @@ -2443,6 +2444,7 @@ Editor::cursor_drag_finished_ensure_locate_callback (ArdourCanvas::Item* item, G if (item == &playhead_cursor->canvas_item) { if (session) { session->request_locate (playhead_cursor->current_frame, drag_info.was_rolling); + _pending_locate_request = true; } } } |