From 001912fb6aaa52459012031aa879cf6ea38b3c4f Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Thu, 24 Jun 2021 11:11:18 -0400 Subject: [PATCH] nemo-view.c: Clear extension menu items during real_update_menus. Extension menu items take a reference to the file selection, and this reference isn't cleared until the next time the extension menu items are fetched (via GClosureNotify), which, as of f5124bc6 is only done during a right-click. Instead, clear the extension actions when real_update_menus runs, which includes after a selection change, and during view location changes. Fixes linuxmint/mint20.2-beta#20. --- src/nemo-view.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nemo-view.c b/src/nemo-view.c index 9e6d8ec2e..9c280df66 100644 --- a/src/nemo-view.c +++ b/src/nemo-view.c @@ -5648,6 +5648,8 @@ add_extension_action_for_files (NemoView *view, gtk_action_set_sensitive (action, sensitive); g_object_set (action, "is-important", priority, NULL); + // FIXME: Don't add the selection to the action data. + // Just grab the selection in the activation callback. data = g_new0 (ExtensionActionCallbackData, 1); data->item = g_object_ref (item); data->view = view; @@ -9604,6 +9606,7 @@ update_configurable_context_menu_items (NemoView *view) static void real_update_menus (NemoView *view) { + GtkUIManager *ui_manager; GList *selection, *l; gint selection_count; const char *tip, *label; @@ -10033,6 +10036,11 @@ real_update_menus (NemoView *view) !selection_contains_recent && !selection_contains_trash); } + ui_manager = nemo_window_get_ui_manager (view->details->window); + nemo_ui_unmerge_ui (ui_manager, + &view->details->extensions_menu_merge_id, + &view->details->extensions_menu_action_group); + update_configurable_context_menu_items (view); nemo_file_list_free (selection);