Multiple entries with same name in "Open With" dialog - report bug?

Forum rules
Before you post please read how to get help
Post Reply

Multiple entries with same name in "Open With" dialog - report bug?

Post by lmuserx4849 » Fri Apr 06, 2018 6:48 pm

In Caja, when I right click a file and select Open With, the dialog contains multiple entries with the same name. There is no way to distinguish one from another.

For example:

Archive Manager
Archive Manager
Archive Manager
Autorun Prompt
Autorun Prompt
ImageMagick (display Q16)
ImageMagick (display Q16)
Okular ... 17 times

This is somehow related to the files in /usr/share/app-install/desktop. Where do I report this as a bug?

Same issue here: "open with"-menu full of rubbish (Mint Mate). I know deleting files is not the answer, but is the problem with whatever app creates the list (Caja?) or is it each applications responsibility.

Dolphin "Open With" brings up a file browser, so you browse to a file. Caja appears to bring up a scrollable list of names gotten from some place.

System: Linux Mint 18.3 Mate

Googling I found: Krita shows multiple times in "open with" dialog (mint/mate 18 x64)

User avatar
Level 24
Level 24
Posts: 23610
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Multiple entries with same name in "Open With" dialog - report bug?

Post by xenopeek » Sat Apr 07, 2018 4:16 am

There's no sense in reporting a bug till more troubleshooting is done.

What type of file did you test this with? On a plain text file I can reproduce it for AptUrl, Help, and ImageMagick but I see only one Archive Manager and only one Autorun Prompt. And you can distinguish them from one another by clicking on the "> Use a custom command" underneath the list to open that box, then clicking on any entries in the list will show their command. The commands are different for identical names in the list.

Looking at the code this list is populated in the function caja_open_with_dialog_add_items_idle in libcaja-private/caja-open-with-dialog.c. On the Caja GitHub project that is here: ... log.c#L683

It just calls the GAppInfo library function g_app_info_get_all to collect all the applications registered on your system: ... fo-get-all. Caja then filters out applications that don't accept a file or URL parameter but keeps everything else. It will show applications in the list that are not shown in your menu because their desktop file has NoDisplay=true set or are excluded by means of OnlyShowIn or NotShowIn. This may be the cause of duplicates.

You should check what the commands of those 3 Archive Managers and 2 Autorun Prompts are. That is interesting to know first.

The GAppInfo documentation shows several options. There is a function g_app_info_should_show to check if the application should be shown which could be used to further filter the list Caja populates. Or g_app_info_get_all_for_type could be used to only show applications that can handle the file type for which the user opened Open With. But using either of those would hide some applications that users would want to be able to select in Open With.

Until we've seen the commands for those 3 Archive Managers and 2 Autorun Prompts I don't think this is a bug. It is a side-effect of how Open With is implemented to give the users the widest possible choice in selecting an application from their system to open their file with. I don't think it is trivial to filter the duplicate names (with different commands) from the list and the above suggested functions in some cases hide more than would be desirable.

Edit: I've deleted your comment from the topic on this forum that you linked to. It's from 2016 and we don't need to revive that one.


Re: Multiple entries with same name in "Open With" dialog

Post by lmuserx4849 » Mon Apr 16, 2018 4:22 am

Thank you for the very informative response. I had to think about this for awhile :-)

Expanding "Use a custom command" (UCC) is a useful tip.

It would be nice if UCC showed the entire command from the Exec key the desktop file. In XFCE-Thunar, when UCC is expanded, the display list becomes gray/disabled and you have to collapse UCC before moving to the next item in the list. In Mate-Caja, the list remains scrollable, so you can move through the list quickly.

Another helpful piece of info would be the fully-qualified desktop name. The very first line after the list box is the Comment value from the desktop file. That line seems to wrap; Add a hypen and the Name, or put it on a line by itself.

For Archive Manager, something like:

Code: Select all

  Create and modify an archive - /usr/share/applications/engrampa.desktop
Coming from KDE, examining the XDG desktop/mime relationship more closely, and being more of a commandline person, using Caja and other file managers has brought to my attention the duplicate menu entries. I understand from reading that okular and krita show up a lot in gnome based desktop menu lists because they have a desktop file per add-on/backend. When scrolling through the Open With list, these KDE apps can consume the entire display at times. KDE seems to have employed a naming convension (i.e., krita_pdf.desktop or okularApplication_pdf.desktop), so I modified the Name key in their desktop files to include the suffix after the underscore. One sed command and repeatable after any LM updates.

It didn't seem to matter what type of file, the Open With list seemed to always be the same, whether text, png, jpg.

I belive the multiple Archive Manager and Auto-run came from multiple desktops on the same machine. I select one from the Display Manager.

Using UCC on the Open With list, Archive Manager appears:

1. engrampa
2. file-roller
3. file-roller

In menulibre:

Archive Manager file-roller %U file-roller.desktop hide=off
Archive Manager engrampa %U engrampa.desktop hide=off
Archive Manager file-roller %U file-roller.desktop hide=off
Archive Manager file-roller %U org.gnome.FileRoller.desktop hide=on

Code: Select all

===> grep -Eir -e '^exec='|grep -Ei -e '(engrampa|file-roller)'
engrampa.desktop:Exec=engrampa %U
org.gnome.FileRoller.desktop:Exec=file-roller %U
file-roller.desktop:Exec=file-roller %U

===> dpkg -S file-roller.desktop
file-roller: /usr/share/applications/file-roller.desktop
app-install-data: /usr/share/app-install/desktop/file-roller:file-roller.desktop

===> dpkg -S org.gnome.FileRoller.desktop
file-roller: /usr/share/applications/org.gnome.FileRoller.desktop 
app-install-data: /usr/share/app-install/desktop/file-roller:org.gnome.FileRoller.desktop 

===> dpkg -S engrampa.desktop
app-install-data: /usr/share/app-install/desktop/engrampa:engrampa.desktop
engrampa: /usr/share/applications/engrampa.desktop  
ubuntu-system-adjustments: /usr/share/ubuntu-system-adjustments/renamed-menu-entries/engrampa.desktop

Post Reply

Return to “MATE”