From 25c0bd9274c541426eb3232b7b697aa3b69f2960 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 25 Mar 2020 18:35:28 -0600 Subject: Prevent updates to the playhead when a locate is pending after a drag/click is used to move the playhead. There are two problem cases: 1) the drag "fake-located" the playhead, but a redraw happens before the locate itself finishes. 2) the transport emits Session::PositionChanged from Session::non_realtime_stop(), even though this is occuring in the "middle" of the locate process (we stop first). In the first case, the drag code sets _pending_locate_request, since we need this to be true even before the queued SessionEvent for the locate has been processed. So to deal with this case In the second case, we use Session::locate_initiated() to decide if we're in the middle of a locate. --- gtk2_ardour/editor.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 12c6ebf413..f455fa992d 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1256,7 +1256,9 @@ Editor::map_position_change (samplepos_t sample) center_screen (sample); } - playhead_cursor->set_position (sample); + if (!_session->locate_initiated()) { + playhead_cursor->set_position (sample); + } } void @@ -5951,7 +5953,9 @@ Editor::super_rapid_screen_update () return; } - playhead_cursor->set_position (sample); + if (!_pending_locate_request) { + playhead_cursor->set_position (sample); + } if (_session->requested_return_sample() >= 0) { _last_update_time = 0; -- cgit v1.2.3