Don't scroll-jump when selecting all tracks
authorRobin Gareus <robin@gareus.org>
Sat, 18 Feb 2017 00:25:13 +0000 (01:25 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 18 Feb 2017 00:25:13 +0000 (01:25 +0100)
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_selection.cc
gtk2_ardour/mixer_ui.cc
gtk2_ardour/public_editor.h

index 75c9da42697e21c857211c86b348924e7eabeee4..512e9ef58e8c9c21f77dacc67639e44aabca1450 100644 (file)
@@ -393,6 +393,7 @@ Editor::Editor ()
        , _all_region_actions_sensitized (false)
        , _ignore_region_action (false)
        , _last_region_menu_was_main (false)
+       , _track_selection_change_without_scroll (false)
        , cd_marker_bar_drag_rect (0)
        , range_bar_drag_rect (0)
        , transport_bar_drag_rect (0)
index 0efacd98eb1190aa763ae85ad499262579b55b29..fb1e4b4bdc8d684b3b3c17d4a609e9b5eda2d8bc 100644 (file)
@@ -1606,6 +1606,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void queue_visual_videotimeline_update ();
        void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true);
 
+       bool track_selection_change_without_scroll () const {
+               return _track_selection_change_without_scroll;
+       }
+
        PBD::Signal0<void> EditorFreeze;
        PBD::Signal0<void> EditorThaw;
 
@@ -1856,6 +1860,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void point_selection_changed ();
        void marker_selection_changed ();
 
+       bool _track_selection_change_without_scroll;
+
        void cancel_selection ();
        void cancel_time_selection ();
 
index 42111c5ffaf8d2ccac1b4b4989e91a8449d4086d..d214d48a320b42127c3a8c761276e270b451fe33 100644 (file)
@@ -21,6 +21,7 @@
 #include <cstdlib>
 
 #include "pbd/stacktrace.h"
+#include "pbd/unwind.h"
 
 #include "ardour/midi_region.h"
 #include "ardour/playlist.h"
@@ -174,6 +175,7 @@ Editor::select_all_tracks ()
                        visible_views.push_back (*i);
                }
        }
+       PBD::Unwinder<bool> uw (_track_selection_change_without_scroll, true);
        selection->set (visible_views);
 }
 
@@ -966,7 +968,9 @@ Editor::track_selection_changed ()
                 * selected, because we always append to that list.
                 */
                set_selected_mixer_strip (*(selection->tracks.back()));
-               ensure_time_axis_view_is_visible (*(selection->tracks.back()), false);
+               if (!_track_selection_change_without_scroll) {
+                       ensure_time_axis_view_is_visible (*(selection->tracks.back()), false);
+               }
                break;
        }
 
index 7d27e54654c996127a4d5a1c0c6b857cadba6f92..12d015d2f8759a9c585fc64915281f961605bc65 100644 (file)
@@ -857,7 +857,7 @@ Mixer_UI::sync_treeview_from_presentation_info (PropertyChange const & what_chan
                        }
                }
 
-               if (!_selection.axes.empty()) {
+               if (!_selection.axes.empty() && !PublicEditor::instance().track_selection_change_without_scroll ()) {
                        move_stripable_into_view ((*_selection.axes.begin())->stripable());
                }
        }
index d1dc082ad4672fca16f7f053b20d74c4b206e8e3..5cfedb11f14e7c47d4dfe02aadcfd753e956cd4f 100644 (file)
@@ -343,6 +343,8 @@ class PublicEditor : public Gtkmm2ext::Tabbable {
        virtual void set_video_timeline_height (const int h) = 0;
        virtual void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true) = 0;
 
+       virtual bool track_selection_change_without_scroll () const = 0;
+
        virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0;
 
        virtual void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&, PBD::PropertyID) const = 0;