Merge pull request #206475 from bobby285271/cinnamon-nemo-fix

cinnamon.nemo: Workaround duplicate right-click menu items

authored by Bobby Rong and committed by GitHub 7dabcc94 95109997

+55
+7
pkgs/desktops/cinnamon/nemo/default.nix
··· 34 34 sha256 = "sha256-ztx3Y+n9Bpzuz06mbkis3kdlM/0JrOaMDbRF5glzkDE="; 35 35 }; 36 36 37 + patches = [ 38 + # Don't populate nemo actions from /run/current-system/sw/share 39 + # They should only be loaded exactly once from $out/share 40 + # https://github.com/NixOS/nixpkgs/issues/190781 41 + ./fix-nemo-actions-duplicate-menu-items.patch 42 + ]; 43 + 37 44 outputs = [ "out" "dev" ]; 38 45 39 46 buildInputs = [
+48
pkgs/desktops/cinnamon/nemo/fix-nemo-actions-duplicate-menu-items.patch
··· 1 + diff --git a/libnemo-private/nemo-action-manager.c b/libnemo-private/nemo-action-manager.c 2 + index 4dac198..b671421 100644 3 + --- a/libnemo-private/nemo-action-manager.c 4 + +++ b/libnemo-private/nemo-action-manager.c 5 + @@ -146,6 +146,8 @@ set_up_actions_directories (NemoActionManager *action_manager) 6 + data_dirs = (gchar **) g_get_system_data_dirs (); 7 + 8 + for (i = 0; i < g_strv_length (data_dirs); i++) { 9 + + if (g_strcmp0 (data_dirs[i], "/run/current-system/sw/share") == 0) 10 + + continue; 11 + path = g_build_filename (data_dirs[i], "nemo", "actions", NULL); 12 + uri = g_filename_to_uri (path, NULL, NULL); 13 + 14 + diff --git a/src/nemo-action-config-widget.c b/src/nemo-action-config-widget.c 15 + index fc4075e..6e1c837 100644 16 + --- a/src/nemo-action-config-widget.c 17 + +++ b/src/nemo-action-config-widget.c 18 + @@ -221,6 +221,8 @@ refresh_widget (NemoActionConfigWidget *widget) 19 + data_dirs = (gchar **) g_get_system_data_dirs (); 20 + 21 + for (i = 0; i < g_strv_length (data_dirs); i++) { 22 + + if (g_strcmp0 (data_dirs[i], "/run/current-system/sw/share") == 0) 23 + + continue; 24 + path = g_build_filename (data_dirs[i], "nemo", "actions", NULL); 25 + populate_from_directory (widget, path); 26 + g_clear_pointer (&path, g_free); 27 + @@ -390,6 +392,8 @@ static void setup_dir_monitors (NemoActionConfigWidget *widget) 28 + 29 + guint i; 30 + for (i = 0; i < g_strv_length (data_dirs); i++) { 31 + + if (g_strcmp0 (data_dirs[i], "/run/current-system/sw/share") == 0) 32 + + continue; 33 + gchar *path = g_build_filename (data_dirs[i], "nemo", "actions", NULL); 34 + try_monitor_path (widget, path); 35 + g_free (path); 36 + diff --git a/src/nemo-script-config-widget.c b/src/nemo-script-config-widget.c 37 + index 3a2d349..b8a85b4 100644 38 + --- a/src/nemo-script-config-widget.c 39 + +++ b/src/nemo-script-config-widget.c 40 + @@ -288,6 +288,8 @@ static void setup_dir_monitors (NemoScriptConfigWidget *widget) 41 + 42 + guint i; 43 + for (i = 0; i < g_strv_length (data_dirs); i++) { 44 + + if (g_strcmp0 (data_dirs[i], "/run/current-system/sw/share") == 0) 45 + + continue; 46 + gchar *path = g_build_filename (data_dirs[i], "nemo", "actions", NULL); 47 + try_monitor_path (widget, path); 48 + g_free (path);