From 75e852451cf24b1d4f26fb56fad7c87e887374b4 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Sun, 3 Jan 2021 09:56:45 +1100 Subject: [PATCH] Fix context menu bug --- v2/internal/ffenestri/ffenestri_darwin.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/v2/internal/ffenestri/ffenestri_darwin.c b/v2/internal/ffenestri/ffenestri_darwin.c index e5cfba9f..d72de4f4 100644 --- a/v2/internal/ffenestri/ffenestri_darwin.c +++ b/v2/internal/ffenestri/ffenestri_darwin.c @@ -357,8 +357,8 @@ void showContextMenu(struct Application *app, const char *contextMenuID) { id contextMenu = (id)hashmap_get(&contextMenuMap, (char*)contextMenuID, strlen(contextMenuID)); if( contextMenu == NULL ) { - printf("No context menu called '%s'. Available:", contextMenuID); - dumpHashmap("contextMenuMap", &contextMenuMap); +// printf("No context menu called '%s'. Available:", contextMenuID); +// dumpHashmap("contextMenuMap", &contextMenuMap); // Free menu id MEMFREE(contextMenuID); @@ -920,11 +920,6 @@ void destroyMenu(struct Application *app) { void destroyContextMenus(struct Application *app) { - // If we don't have a context menu, return - if( app->contextMenusAsJSON == NULL ) { - return; - } - // Free menu item hashmap hashmap_destroy(&menuItemMapForContextMenus); @@ -2405,9 +2400,6 @@ void dumpContextMenus(struct Application *app) { void parseContextMenus(struct Application *app) { - // Allocation the hashmaps we need - allocateContextMenuHashMaps(app); - // Parse the context menu json app->processedContextMenus = json_decode(app->contextMenusAsJSON); @@ -2800,6 +2792,9 @@ void Run(struct Application *app, int argc, char **argv) { parseTrayData(app); } + // Allocation the hashmaps we need + allocateContextMenuHashMaps(app); + // If we have context menus, process them if( app->contextMenusAsJSON != NULL ) { parseContextMenus(app);