Skip to content

Commit 001912f

Browse files
committed
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 f5124bc 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.
1 parent 659362f commit 001912f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/nemo-view.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5648,6 +5648,8 @@ add_extension_action_for_files (NemoView *view,
56485648
gtk_action_set_sensitive (action, sensitive);
56495649
g_object_set (action, "is-important", priority, NULL);
56505650

5651+
// FIXME: Don't add the selection to the action data.
5652+
// Just grab the selection in the activation callback.
56515653
data = g_new0 (ExtensionActionCallbackData, 1);
56525654
data->item = g_object_ref (item);
56535655
data->view = view;
@@ -9604,6 +9606,7 @@ update_configurable_context_menu_items (NemoView *view)
96049606
static void
96059607
real_update_menus (NemoView *view)
96069608
{
9609+
GtkUIManager *ui_manager;
96079610
GList *selection, *l;
96089611
gint selection_count;
96099612
const char *tip, *label;
@@ -10033,6 +10036,11 @@ real_update_menus (NemoView *view)
1003310036
!selection_contains_recent && !selection_contains_trash);
1003410037
}
1003510038

10039+
ui_manager = nemo_window_get_ui_manager (view->details->window);
10040+
nemo_ui_unmerge_ui (ui_manager,
10041+
&view->details->extensions_menu_merge_id,
10042+
&view->details->extensions_menu_action_group);
10043+
1003610044
update_configurable_context_menu_items (view);
1003710045

1003810046
nemo_file_list_free (selection);

0 commit comments

Comments
 (0)