diff --git a/gtk2_ardour/audio_clip_editor.cc b/gtk2_ardour/audio_clip_editor.cc index e6913305ca..2723856736 100644 --- a/gtk2_ardour/audio_clip_editor.cc +++ b/gtk2_ardour/audio_clip_editor.cc @@ -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 (); } } diff --git a/gtk2_ardour/cue_editor.cc b/gtk2_ardour/cue_editor.cc index b890e3743b..d41b568c65 100644 --- a/gtk2_ardour/cue_editor.cc +++ b/gtk2_ardour/cue_editor.cc @@ -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) { diff --git a/gtk2_ardour/cue_editor.h b/gtk2_ardour/cue_editor.h index 9f4335aa0d..04616ce1f0 100644 --- a/gtk2_ardour/cue_editor.h +++ b/gtk2_ardour/cue_editor.h @@ -258,5 +258,9 @@ class CueEditor : public EditingContext, public PBD::HistoryOwner virtual void set_from_rsu (RegionUISettings&); void metric_get_bbt (std::vector&, samplepos_t, samplepos_t, gint); + + bool _scroll_drag; + bool hscroll_press (GdkEventButton*); + bool hscroll_release (GdkEventButton*); }; diff --git a/gtk2_ardour/pianoroll.cc b/gtk2_ardour/pianoroll.cc index 7d395bee1b..91b3b6abce 100644 --- a/gtk2_ardour/pianoroll.cc +++ b/gtk2_ardour/pianoroll.cc @@ -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 (); } }