From 3f15a3a402e670e72caf986b966588238450620f Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Mon, 1 May 2023 08:46:00 -0500 Subject: [PATCH] set playhead sensitivity via config (defaulted insensitive) * in the 'fake_drag' case (dragging the playhead from the ruler), the mouse events are delivered to the playhead during the drag so we need to temporarily sensitize the playhead during that operation, then reset the sensitivity via config --- gtk2_ardour/editor_canvas.cc | 1 + gtk2_ardour/editor_drag.cc | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 873484cd29..67c53584d8 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -270,6 +270,7 @@ Editor::initialize_canvas () transport_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), transport_marker_bar, TransportMarkerBarItem, "transport marker bar")); _playhead_cursor = new EditorCursor (*this, &Editor::canvas_playhead_cursor_event, X_("playhead")); + _playhead_cursor->set_sensitive (UIConfiguration::instance().get_sensitize_playhead()); _snapped_cursor = new EditorCursor (*this, X_("snapped")); diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 37b9e9ee56..8de0576c8e 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3997,6 +3997,9 @@ CursorDrag::start_grab (GdkEvent* event, Gdk::Cursor* c) } } + /* during fake-locate, the mouse position is delievered to the (red) playhead line, so we have to momentarily sensitize it */ + _editor->playhead_cursor ()->set_sensitive(true); + fake_locate (where.earlier (snap_delta (event->button.state)).samples()); _last_mx = event->button.x; @@ -4069,6 +4072,8 @@ CursorDrag::finished (GdkEvent* event, bool movement_occurred) s->request_locate (_editor->playhead_cursor ()->current_sample (), false, _was_rolling ? MustRoll : RollIfAppropriate); s->request_resume_timecode_transmission (); } + + _editor->playhead_cursor ()->set_sensitive(UIConfiguration::instance().get_sensitize_playhead()); } void @@ -4082,6 +4087,7 @@ CursorDrag::aborted (bool) } _editor->playhead_cursor()->set_position (adjusted_time (grab_time (), 0, false).samples()); + _editor->playhead_cursor ()->set_sensitive(UIConfiguration::instance().get_sensitize_playhead()); } FadeInDrag::FadeInDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list const & v, Temporal::TimeDomain td)