diff options
author | Carl Hetherington <carl@carlh.net> | 2009-02-17 00:12:22 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-02-17 00:12:22 +0000 |
commit | 4565b73a3993b0cb5ccb9170e276180f2b5c1372 (patch) | |
tree | 18ab6fc28523856e88832917c6ab92c36db6310b /gtk2_ardour | |
parent | 3e1eb6bcbd1bf5b9f3bfb64d8b9a5ad68c01368c (diff) |
Fix for visual glitch due to race between Editor::update_current_screen being called and a locate event being processed.
git-svn-id: svn://localhost/ardour2/branches/3.0@4608 d708f5d6-7413-0410-9779-e7cbd77b26cf
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; } } } |