From 4e78f2514964ff2c669bb63658d22f0e80834ba6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 24 Aug 2025 15:06:16 +0200 Subject: [PATCH] Don't update bottom attachment when it's not visible --- gtk2_ardour/selection_properties_box.cc | 20 +++++++++++++++++++- gtk2_ardour/selection_properties_box.h | 3 +++ 2 files changed, 22 insertions(+), 1 deletion(-) 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;