From f9a121ce9c51490ed11c8092acf1d2b62ea36a8b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 7 Sep 2023 14:06:00 -0600 Subject: [PATCH] click (no drag) on markers locates there, unless using marker as edit point --- gtk2_ardour/editor.h | 2 ++ gtk2_ardour/editor_drag.cc | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 7081f1f23d..065b33d8cd 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1780,6 +1780,8 @@ private: void mid_tempo_change (MidTempoChanges); + Editing::EditPoint edit_point() const { return _edit_point; } + protected: void _commit_tempo_map_edit (Temporal::TempoMap::WritableSharedPtr&, bool with_update = false); diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index d8db859438..7159818a17 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -4637,7 +4637,7 @@ MarkerDrag::finished (GdkEvent* event, bool movement_occurred) } /* just a click, do nothing but finish - off the selection process + off the selection process (and locate if appropriate) */ Selection::Operation op = ArdourKeyboard::selection_type (event->button.state); @@ -4666,6 +4666,14 @@ MarkerDrag::finished (GdkEvent* event, bool movement_occurred) _editor->commit_reversible_selection_op (); } + if (_editor->edit_point() != Editing::EditAtSelectedMarker) { + bool is_start; + Location* location = _editor->find_location_from_marker (_marker, is_start); + if (location) { + _editor->session ()->request_locate (is_start ? location->start().samples() : location->end().samples()); + } + } + return; }