diff --git a/libs/gtkmm2ext/utils.cc b/libs/gtkmm2ext/utils.cc index 4ba85e2f25..d4e9c57d58 100644 --- a/libs/gtkmm2ext/utils.cc +++ b/libs/gtkmm2ext/utils.cc @@ -396,7 +396,8 @@ _position_menu_anchored (int& x, int& y, bool& push_in, MenuList::const_iterator i = items.begin(); for ( ; i != items.end(); ++i) { - if (selected == ((std::string) i->get_label())) { + const Label* label_widget = dynamic_cast(i->get_child()); + if (label_widget && selected == ((std::string) label_widget->get_label())) { break; } offset += i->size_request().height;