From 43e4e428f5ee2a5725b91d36ce4b57fd408955db Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 19 Aug 2025 20:01:57 +0200 Subject: [PATCH] Handle case where a custom MenuElem is added to the dropdown --- libs/widgets/ardour_dropdown.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/widgets/ardour_dropdown.cc b/libs/widgets/ardour_dropdown.cc index 732a064bfd..e7763db0ce 100644 --- a/libs/widgets/ardour_dropdown.cc +++ b/libs/widgets/ardour_dropdown.cc @@ -82,11 +82,14 @@ ArdourDropdown::on_button_press_event (GdkEventButton* ev) void ArdourDropdown::set_active (std::string const& text) { - LblMenuItem const* current_active = dynamic_cast (_menu.get_active ()); - if (current_active && current_active->label() == text) { + MenuItem const* current_active = _menu.get_active(); + LblMenuItem const* current_lblitem = dynamic_cast (current_active); + + if ((current_lblitem && current_lblitem->label() == text) || (current_active && current_active->get_label() == text)) { set_text (text); return; } + using namespace Menu_Helpers; int c = 0; for (auto& i : _menu.items()) {