Extract/Compress menu items are hidden if extension menu items present
Affected version
- Nightly flatpak: Not testable because it doesn't support external extensions at the moment
- Other: git master version built with JHBuild.
Steps to reproduce
- Have an installed extension which adds a menu item to the selection context menu
- Open the context menu of a file where the extension menu item should appear
Current behavior
The "Extract Here", "Extract to…" or "Compress…" actions are not displayed if a extension's menu item is present.
Expected behavior
The "Extract Here", "Extract to…" or "Compress…" action should be present regardless of menu extensions.
Additional information
Credit goes to @rastersoft and @muktupavels for finding this bug.
This bug happens because these actions are listed in the "selection-extensions-section"
section of the UI definition. This section is overwritten with extension menu items if any are present.
This regression is caused by bd81bd89, where the new nautilus_gmenu_set_from_model()
resets the existing model of the section, instead of appending it.
Now, reseting the section is not wrong, because extension menu items should only be added once. What's wrong is the UI definition, which adds regular actions to a section that's for extensions only.
Proposed Solution
Mmove the "Extract Here", "Extract to…" and "Compress…" action items to their own section, to make the "selection-extensions-section"
menu section empty by default.
This is an easy task, that requires only basic XML understanding. For the curious, an introduction to the GMenu XML format can be found here: https://developer.gnome.org/GMenu/
Building with JHBuild is not required, nor recommended for newcomers. You can use GNOME Builder test it builds.