diff --git a/gtk2_ardour/selection_properties_box.cc b/gtk2_ardour/selection_properties_box.cc index bc1efed0d5..c19ec00dde 100644 --- a/gtk2_ardour/selection_properties_box.cc +++ b/gtk2_ardour/selection_properties_box.cc @@ -121,6 +121,24 @@ SelectionPropertiesBox::track_mouse_mode () /* maybe do something here? */ } +void +SelectionPropertiesBox::on_map () +{ + HBox::on_map (); + SelectionPropertiesBox::selection_changed (); +} + +void +SelectionPropertiesBox::on_unmap () +{ + /* This also triggers when switching pages, or hiding the GUI + * perhaps consider show/hide get_visible() instead. + */ + HBox::on_unmap (); + SelectionPropertiesBox::selection_changed (); + _route_prop_box->set_route (std::shared_ptr()); +} + void SelectionPropertiesBox::delete_region_editor () { @@ -140,7 +158,7 @@ SelectionPropertiesBox::delete_region_editor () void SelectionPropertiesBox::selection_changed () { - if (!_session || _session->inital_connect_or_deletion_in_progress ()) { + if (!_session || _session->inital_connect_or_deletion_in_progress () || !get_mapped ()) { _time_info_box->hide (); _route_prop_box->hide (); _slot_prop_box->hide (); diff --git a/gtk2_ardour/selection_properties_box.h b/gtk2_ardour/selection_properties_box.h index 7bc91f1181..c4bc056421 100644 --- a/gtk2_ardour/selection_properties_box.h +++ b/gtk2_ardour/selection_properties_box.h @@ -58,6 +58,9 @@ private: void track_mouse_mode (); void delete_region_editor (); + void on_map (); + void on_unmap (); + TimeInfoBox* _time_info_box; RoutePropertiesBox* _route_prop_box; SlotPropertiesBox* _slot_prop_box;