🥅 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,11 +134,14 @@ bool AModule::handleUserEvent(GdkEventButton* const& e) {
format = rec->second; format = rec->second;
} }
// Check if the event is the one specified for the "menu" option // Check that a menu has been configured
if (rec->second == config_["menu"].asString()) { if (config_["menu"].isString()) {
// Popup the menu // Check if the event is the one specified for the "menu" option
gtk_widget_show_all(GTK_WIDGET(menu_)); if (rec->second == config_["menu"].asString()) {
gtk_menu_popup_at_pointer(GTK_MENU(menu_), reinterpret_cast<GdkEvent*>(e)); // Popup the menu
gtk_widget_show_all(GTK_WIDGET(menu_));
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()) {