13
0

Allow calling Dropdown::set_active from a signal handler

This breaks a potential recursion when set_active() is called
from activate_item(). See also 88fc22610
This commit is contained in:
Robin Gareus 2019-10-21 14:58:59 +02:00
parent b523583bb4
commit 08a9368adf
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -83,6 +83,11 @@ ArdourDropdown::on_button_press_event (GdkEventButton* ev)
void
ArdourDropdown::set_active (std::string const& text)
{
const MenuItem* current_active = _menu.get_active();
if (current_active && current_active->get_label() == text) {
set_text (text);
return;
}
using namespace Menu_Helpers;
const MenuList& items = _menu.items ();
int c = 0;