diff options
author | Bobby Rong <rjl931189261@126.com> | 2022-12-17 11:34:51 +0800 |
---|---|---|
committer | Bobby Rong <rjl931189261@126.com> | 2022-12-17 11:41:17 +0800 |
commit | 5cc5f394d7bc74ed9ce8b5dd59831e8053b74330 (patch) | |
tree | b785d863d565130ac5fb42645768fd8bc9a086fc /pkgs/desktops | |
parent | 7f24fbbde93040b82f200b7380bd0534084a1c86 (diff) |
cinnamon.nemo: Workaround duplicate right-click menu items
Don't populate nemo actions from /run/current-system/sw/share They should only be loaded exactly once as $out/share
Diffstat (limited to 'pkgs/desktops')
-rw-r--r-- | pkgs/desktops/cinnamon/nemo/default.nix | 7 | ||||
-rw-r--r-- | pkgs/desktops/cinnamon/nemo/fix-nemo-actions-duplicate-menu-items.patch | 48 |
2 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/desktops/cinnamon/nemo/default.nix b/pkgs/desktops/cinnamon/nemo/default.nix index 82cd30488c427..6af812141d3f4 100644 --- a/pkgs/desktops/cinnamon/nemo/default.nix +++ b/pkgs/desktops/cinnamon/nemo/default.nix @@ -34,6 +34,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-ztx3Y+n9Bpzuz06mbkis3kdlM/0JrOaMDbRF5glzkDE="; }; + patches = [ + # Don't populate nemo actions from /run/current-system/sw/share + # They should only be loaded exactly once from $out/share + # https://github.com/NixOS/nixpkgs/issues/190781 + ./fix-nemo-actions-duplicate-menu-items.patch + ]; + outputs = [ "out" "dev" ]; buildInputs = [ diff --git a/pkgs/desktops/cinnamon/nemo/fix-nemo-actions-duplicate-menu-items.patch b/pkgs/desktops/cinnamon/nemo/fix-nemo-actions-duplicate-menu-items.patch new file mode 100644 index 0000000000000..3a555774c4504 --- /dev/null +++ b/pkgs/desktops/cinnamon/nemo/fix-nemo-actions-duplicate-menu-items.patch @@ -0,0 +1,48 @@ +diff --git a/libnemo-private/nemo-action-manager.c b/libnemo-private/nemo-action-manager.c +index 4dac198..b671421 100644 +--- a/libnemo-private/nemo-action-manager.c ++++ b/libnemo-private/nemo-action-manager.c +@@ -146,6 +146,8 @@ set_up_actions_directories (NemoActionManager *action_manager) + data_dirs = (gchar **) g_get_system_data_dirs (); + + for (i = 0; i < g_strv_length (data_dirs); i++) { ++ if (g_strcmp0 (data_dirs[i], "/run/current-system/sw/share") == 0) ++ continue; + path = g_build_filename (data_dirs[i], "nemo", "actions", NULL); + uri = g_filename_to_uri (path, NULL, NULL); + +diff --git a/src/nemo-action-config-widget.c b/src/nemo-action-config-widget.c +index fc4075e..6e1c837 100644 +--- a/src/nemo-action-config-widget.c ++++ b/src/nemo-action-config-widget.c +@@ -221,6 +221,8 @@ refresh_widget (NemoActionConfigWidget *widget) + data_dirs = (gchar **) g_get_system_data_dirs (); + + for (i = 0; i < g_strv_length (data_dirs); i++) { ++ if (g_strcmp0 (data_dirs[i], "/run/current-system/sw/share") == 0) ++ continue; + path = g_build_filename (data_dirs[i], "nemo", "actions", NULL); + populate_from_directory (widget, path); + g_clear_pointer (&path, g_free); +@@ -390,6 +392,8 @@ static void setup_dir_monitors (NemoActionConfigWidget *widget) + + guint i; + for (i = 0; i < g_strv_length (data_dirs); i++) { ++ if (g_strcmp0 (data_dirs[i], "/run/current-system/sw/share") == 0) ++ continue; + gchar *path = g_build_filename (data_dirs[i], "nemo", "actions", NULL); + try_monitor_path (widget, path); + g_free (path); +diff --git a/src/nemo-script-config-widget.c b/src/nemo-script-config-widget.c +index 3a2d349..b8a85b4 100644 +--- a/src/nemo-script-config-widget.c ++++ b/src/nemo-script-config-widget.c +@@ -288,6 +288,8 @@ static void setup_dir_monitors (NemoScriptConfigWidget *widget) + + guint i; + for (i = 0; i < g_strv_length (data_dirs); i++) { ++ if (g_strcmp0 (data_dirs[i], "/run/current-system/sw/share") == 0) ++ continue; + gchar *path = g_build_filename (data_dirs[i], "nemo", "actions", NULL); + try_monitor_path (widget, path); + g_free (path); |