diff options
author | Robin Gareus <robin@gareus.org> | 2019-10-21 14:58:59 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-10-21 14:58:59 +0200 |
commit | 08a9368adf649d82bedecf70b5801f45da91c8da (patch) | |
tree | 262a0d804027322a3e1963f8b2b93a2d6e67ee3a /libs/widgets | |
parent | b523583bb412a2545a0923674e0ef6715792a38f (diff) |
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
Diffstat (limited to 'libs/widgets')
-rw-r--r-- | libs/widgets/ardour_dropdown.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/widgets/ardour_dropdown.cc b/libs/widgets/ardour_dropdown.cc index 822d1fdb26..573b808414 100644 --- a/libs/widgets/ardour_dropdown.cc +++ b/libs/widgets/ardour_dropdown.cc @@ -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; |