🥅 only check menu if speciifed in the conf

This commit is contained in:
Benjamin Voisin 2024-05-28 17:20:31 +02:00
parent 21751b2faa
commit c3581fb66b
No known key found for this signature in database
GPG Key ID: C5C8EDD125FBFD78
1 changed files with 8 additions and 5 deletions

View File

@ -134,12 +134,15 @@ bool AModule::handleUserEvent(GdkEventButton* const& e) {
format = rec->second; format = rec->second;
} }
// Check that a menu has been configured
if (config_["menu"].isString()) {
// Check if the event is the one specified for the "menu" option // Check if the event is the one specified for the "menu" option
if (rec->second == config_["menu"].asString()) { if (rec->second == config_["menu"].asString()) {
// Popup the menu // Popup the menu
gtk_widget_show_all(GTK_WIDGET(menu_)); gtk_widget_show_all(GTK_WIDGET(menu_));
gtk_menu_popup_at_pointer(GTK_MENU(menu_), reinterpret_cast<GdkEvent*>(e)); gtk_menu_popup_at_pointer(GTK_MENU(menu_), reinterpret_cast<GdkEvent*>(e));
} }
}
// Second call user scripts // Second call user scripts
if (!format.empty()) { if (!format.empty()) {
if (config_[format].isString()) if (config_[format].isString())