fix interference between timer-based update in CueEditors and scroll-drag

This commit is contained in:
Paul Davis 2025-08-14 14:54:37 -06:00
parent 1ff9bf3e86
commit 63db3d3736
4 changed files with 24 additions and 2 deletions

View file

@ -721,7 +721,7 @@ AudioClipEditor::maybe_update ()
_playhead_cursor->set_position (0);
}
if (follow_playhead()) {
if (_session->transport_rolling() && follow_playhead() && !_scroll_drag) {
reset_x_origin_to_follow_playhead ();
}
}

View file

@ -55,9 +55,13 @@ CueEditor::CueEditor (std::string const & name, bool with_transport)
, zoom_in_allocate (false)
, timebar_height (15.)
, n_timebars (0)
, _scroll_drag (false)
{
_canvas_hscrollbar = manage (new Gtk::HScrollbar (horizontal_adjustment));
_canvas_hscrollbar->show ();
_canvas_hscrollbar->signal_button_press_event().connect (sigc::mem_fun (*this, &CueEditor::hscroll_press), false);
_canvas_hscrollbar->signal_button_release_event().connect (sigc::mem_fun (*this, &CueEditor::hscroll_release), false);
horizontal_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &CueEditor::scrolled));
_history.Changed.connect (history_connection, invalidator (*this), std::bind (&CueEditor::history_changed, this), gui_context());
@ -68,6 +72,20 @@ CueEditor::~CueEditor ()
delete own_bindings;
}
bool
CueEditor::hscroll_press (GdkEventButton* ev)
{
_scroll_drag = true;
return false;
}
bool
CueEditor::hscroll_release (GdkEventButton* ev)
{
_scroll_drag = false;
return false;
}
void
CueEditor::set_snapped_cursor_position (Temporal::timepos_t const & pos)
{

View file

@ -258,5 +258,9 @@ class CueEditor : public EditingContext, public PBD::HistoryOwner
virtual void set_from_rsu (RegionUISettings&);
void metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>&, samplepos_t, samplepos_t, gint);
bool _scroll_drag;
bool hscroll_press (GdkEventButton*);
bool hscroll_release (GdkEventButton*);
};

View file

@ -573,7 +573,7 @@ Pianoroll::maybe_update ()
_playhead_cursor->set_position (0);
}
if (follow_playhead()) {
if (_session->transport_rolling() && follow_playhead() && !_scroll_drag) {
reset_x_origin_to_follow_playhead ();
}
}