13
0

Tweak 842d758e: selection & move into view

Use separate editor + mixer flags for moving selected tracks into view.
Changing selection in the Editor will only pan the mixer-view and vice-
versa. This fixes an issue with the track that is being clicked-on to
be moved out of view (due to groups)
This commit is contained in:
Robin Gareus 2017-10-21 17:27:03 +02:00
parent 63b6ab1101
commit 231e25544b
5 changed files with 19 additions and 3 deletions

View File

@ -400,6 +400,7 @@ Editor::Editor ()
, _ignore_region_action (false)
, _last_region_menu_was_main (false)
, _track_selection_change_without_scroll (false)
, _editor_track_selection_change_without_scroll (false)
, cd_marker_bar_drag_rect (0)
, range_bar_drag_rect (0)
, transport_bar_drag_rect (0)

View File

@ -1883,6 +1883,7 @@ private:
void marker_selection_changed ();
bool _track_selection_change_without_scroll;
bool _editor_track_selection_change_without_scroll;
void cancel_selection ();
void cancel_time_selection ();

View File

@ -191,7 +191,7 @@ Editor::set_selected_track_as_side_effect (Selection::Operation op)
return;
}
PBD::Unwinder<bool> uw (_track_selection_change_without_scroll, true);
PBD::Unwinder<bool> uw (_editor_track_selection_change_without_scroll, true);
RouteGroup* group = NULL;
if (clicked_routeview) {
@ -1039,7 +1039,7 @@ Editor::presentation_info_changed (PropertyChange const & what_changed)
break;
default:
set_selected_mixer_strip (*(selection->tracks.back()));
if (!_track_selection_change_without_scroll) {
if (!_track_selection_change_without_scroll && !_editor_track_selection_change_without_scroll) {
ensure_time_axis_view_is_visible (*(selection->tracks.back()), false);
}
break;

View File

@ -111,6 +111,7 @@ Mixer_UI::Mixer_UI ()
, _route_deletion_in_progress (false)
, _maximised (false)
, _show_mixer_list (true)
, _strip_selection_change_without_scroll (false)
, myactions (X_("mixer"))
, _selection (*this, *this)
{
@ -826,7 +827,7 @@ Mixer_UI::sync_treeview_from_presentation_info (PropertyChange const & what_chan
}
}
if (!_selection.axes.empty() && !PublicEditor::instance().track_selection_change_without_scroll ()) {
if (!_selection.axes.empty() && !PublicEditor::instance().track_selection_change_without_scroll () && !_strip_selection_change_without_scroll) {
move_stripable_into_view ((*_selection.axes.begin())->stripable());
}
@ -918,6 +919,17 @@ struct MixerStripSorter {
bool
Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
{
/* Selecting a mixer-strip may also select grouped-tracks, and
* presentation_info_changed() being emitted and
* _selection.axes.begin() is being moved into view. This may
* effectively move the track that was clicked-on out of view.
*
* So here only the track that is actually clicked-on is moved into
* view (in case it's partially visible)
*/
PBD::Unwinder<bool> uw (_strip_selection_change_without_scroll, true);
move_stripable_into_view (strip->stripable());
if (ev->button == 1) {
if (_selection.selected (strip)) {
/* primary-click: toggle selection state of strip */

View File

@ -376,6 +376,8 @@ private:
// true if mixer list is visible
bool _show_mixer_list;
bool _strip_selection_change_without_scroll;
mutable boost::weak_ptr<ARDOUR::Stripable> spilled_strip;
void escape ();