diff --git a/src/menu.c b/src/menu.c index b99d8ae..f2bc7b9 100644 --- a/src/menu.c +++ b/src/menu.c @@ -312,13 +312,19 @@ static GList *get_actionable_notifications(void) /* see menu.h */ void context_menu(void) +{ + GList *notifications = get_actionable_notifications(); + context_menu_for(notifications); +} + +/* see menu.h */ +void context_menu_for(GList *notifications) { if (menu_ctx.locked_notifications) { LOG_W("Context menu already running, refusing to rerun"); return; } - GList *notifications = get_actionable_notifications(); menu_ctx.locked_notifications = notifications; GError *err = NULL; diff --git a/src/menu.h b/src/menu.h index bf7fd0b..5263c58 100644 --- a/src/menu.h +++ b/src/menu.h @@ -2,6 +2,8 @@ #ifndef DUNST_MENU_H #define DUNST_MENU_H +#include + /** * Extract all urls from the given string. * @@ -16,9 +18,15 @@ void invoke_action(const char *action); void regex_teardown(void); /** - * Open the context menu that lets the user select urls/actions/etc. + * Open the context menu that lets the user select urls/actions/etc for all displayed notifications. */ void context_menu(void); +/** + * Open the context menu that lets the user select urls/actions/etc for the specified notifications. + * @param notifications (nullable) List of notifications for which the context menu should be opened + */ +void context_menu_for(GList *notifications); + #endif /* vim: set ft=c tabstop=8 shiftwidth=8 expandtab textwidth=0: */