diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 0213e901d5..eacd83316c 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -529,13 +529,13 @@ AutomationTimeAxisView::clear_clicked () } void -AutomationTimeAxisView::set_height (uint32_t h, TrackHeightMode m) +AutomationTimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle) { bool const changed = (height != (uint32_t) h) || first_call_to_set_height; uint32_t const normal = preset_height (HeightNormal); bool const changed_between_small_and_normal = ( (height < normal && h >= normal) || (height >= normal || h < normal) ); - TimeAxisView::set_height (h, m); + TimeAxisView::set_height (h, m, from_idle); _base_rect->set_y1 (h); diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h index 68e0d6c3c6..c883c09125 100644 --- a/gtk2_ardour/automation_time_axis.h +++ b/gtk2_ardour/automation_time_axis.h @@ -78,7 +78,7 @@ public: ~AutomationTimeAxisView(); - virtual void set_height (uint32_t, TrackHeightMode m = OnlySelf); + virtual void set_height (uint32_t, TrackHeightMode m = OnlySelf, bool from_idle = false); void set_samples_per_pixel (double); std::string name() const { return _name; } Gdk::Color color () const; diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 3a8c95dafe..3e65a018cb 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -7929,6 +7929,12 @@ Editor::set_track_height (Height h) for (TrackSelection::iterator x = ts.begin(); x != ts.end(); ++x) { (*x)->set_height_enum (h); } + + /* when not setting height from a drag, nothing will cause a redisplay + of the non-altered tracks. Do that explicitly. + */ + + queue_redisplay_track_views (); } void diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 2f63747ea9..1c359b171e 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -571,7 +571,7 @@ MidiTimeAxisView::update_midi_controls_visibility (uint32_t h) } void -MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m) +MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle) { update_midi_controls_visibility (h); @@ -588,7 +588,7 @@ MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m) * which needs to know if we have just shown or hidden a scroomer / * piano roll. */ - RouteTimeAxisView::set_height (h, m); + RouteTimeAxisView::set_height (h, m, from_idle); } void diff --git a/gtk2_ardour/midi_time_axis.h b/gtk2_ardour/midi_time_axis.h index 5778d7d436..e993d39a45 100644 --- a/gtk2_ardour/midi_time_axis.h +++ b/gtk2_ardour/midi_time_axis.h @@ -85,7 +85,7 @@ public: MidiStreamView* midi_view(); - void set_height (uint32_t, TrackHeightMode m = OnlySelf); + void set_height (uint32_t, TrackHeightMode m = OnlySelf, bool from_idle = false); void set_layer_display (LayerDisplay d); boost::shared_ptr add_region (Temporal::timepos_t const &, Temporal::timecnt_t const &, bool); diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index b849ce6687..0978083b81 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -550,6 +550,8 @@ public: virtual bool should_ripple () const = 0; + virtual void queue_redisplay_track_views () = 0; + /// Singleton instance, set up by Editor::Editor() static PublicEditor* _instance; diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 12799ab21c..f7716841a8 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -959,7 +959,7 @@ RouteTimeAxisView::show_selection (TimeSelection& ts) } void -RouteTimeAxisView::set_height (uint32_t h, TrackHeightMode m) +RouteTimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle) { int gmlen = h - 9; bool height_changed = (height == 0) || (h != height); @@ -970,7 +970,7 @@ RouteTimeAxisView::set_height (uint32_t h, TrackHeightMode m) } gm.get_level_meter().setup_meters (gmlen, meter_width); - TimeAxisView::set_height (h, m); + TimeAxisView::set_height (h, m, from_idle); if (_view) { _view->set_height ((double) current_height()); diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index f146f80acb..ecf22c20e0 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -94,7 +94,7 @@ public: void set_button_names (); void set_samples_per_pixel (double); - void set_height (uint32_t h, TrackHeightMode m = OnlySelf); + void set_height (uint32_t h, TrackHeightMode m = OnlySelf, bool from_idle = false); void show_timestretch (Temporal::timepos_t const & start, Temporal::timepos_t const & end, int layers, int layer); void hide_timestretch (); void selection_click (GdkEventButton*); diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 3e382a23c5..05a38ebec1 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -446,10 +446,9 @@ TimeAxisView::controls_ebox_button_press (GdkEventButton* event) void TimeAxisView::idle_resize (int32_t h) { - set_height (std::max(0, h)); + set_height (std::max(0, h), OnlySelf, true); } - bool TimeAxisView::controls_ebox_motion (GdkEventMotion* ev) { @@ -600,7 +599,7 @@ TimeAxisView::set_height_enum (Height h, bool apply_to_selection) } void -TimeAxisView::set_height (uint32_t h, TrackHeightMode m) +TimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle) { uint32_t lanes = 0; if (m == TotalHeight) { @@ -637,6 +636,10 @@ TimeAxisView::set_height (uint32_t h, TrackHeightMode m) } _editor.override_visible_track_count (); + + if (!from_idle) { + _editor.queue_redisplay_track_views (); + } } void diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index a4d1b9c7ae..27e01e13a2 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -159,7 +159,7 @@ public: HeightPerLane }; - virtual void set_height (uint32_t h, TrackHeightMode m = OnlySelf); + virtual void set_height (uint32_t h, TrackHeightMode m = OnlySelf, bool from_idle = false); void set_height_enum (Height, bool apply_to_selection = false); void reset_height(); diff --git a/gtk2_ardour/vca_time_axis.cc b/gtk2_ardour/vca_time_axis.cc index 754a8b4508..0d4b5b1eaa 100644 --- a/gtk2_ardour/vca_time_axis.cc +++ b/gtk2_ardour/vca_time_axis.cc @@ -354,9 +354,10 @@ VCATimeAxisView::color () const } void -VCATimeAxisView::set_height (uint32_t h, TrackHeightMode m) +VCATimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle) { - TimeAxisView::set_height (h, m); + TimeAxisView::set_height (h, m, from_idle); + if (height >= preset_height (HeightNormal)) { drop_button.show (); automation_button.show (); diff --git a/gtk2_ardour/vca_time_axis.h b/gtk2_ardour/vca_time_axis.h index f95a44465f..74d051d0a9 100644 --- a/gtk2_ardour/vca_time_axis.h +++ b/gtk2_ardour/vca_time_axis.h @@ -51,7 +51,7 @@ public: Gdk::Color color () const; std::string state_id() const; - void set_height (uint32_t h, TrackHeightMode m = OnlySelf); + void set_height (uint32_t h, TrackHeightMode m = OnlySelf, bool from_idle = false); bool marked_for_display () const; bool set_marked_for_display (bool);