Comment 4 for bug 591693

Revision history for this message
Doug Morse (dm-dougmorse) wrote :

[possibly SOLVED]

I have located and corrected the bug, at least in my case.

SHORT ANSWER

Edit $HOME/.local/share/applications/mimeapps.list, find the section [Added Associations] and within that section fine a line that starts with

  text/html=

and make your preferred browser the FIRST entry after the equal sign (=).

LONG ANSWER

The file $HOME/.local/share/applications/mimeapps.list seems to be the first thing checked for running a .desktop file (see attached example), even preempting System -> Preferences -> Preferred Applications and alternatives set by running "sudo update-alternatives --config x-www-browser".

The first part of my mimeapps.list file used to be:

  [Added Associations]
  text/html=opera.desktop;firefox.desktop;[....]

and I changed it to:

  [Added Associations]
  text/html=firefox.desktop;opera.desktop;[....]

As soon as I did so, double-clicking on a .desktop link / URL started opening firefox instead of opera (which is what I wanted). (Note that I also deleted the mimeinfo.cache file in the same directory, by I'm confident it was not the source of the problem -- I can explain why if needed).

Thus, it would appear that whatever entry comes FIRST on the "text/html=" line is what Gnome runs when a user double-clicks on a desktop URL file. IMHO this is a bug, as I would think that most users, such as Jakob and myself, expect the Preferred Application setting be used, not some setting in a file that we have to know about and can only affect by editing manually.

More generally, I suspect this behavior holds for all entries listed under the [Added Associations] section. I would suggest that, if more than one association exists for a file type specified in this section, Gnome then include an "Open with..." option on the right-clicking on the .desktop file, and that the subsequent dialog box allowing the user to select which program to run also have a checkbox with labeled something like "Remember this application for 'xxxx' files." When checked, Gnome would then re-order the corresponding entry in the [Added Associations] section such that the choosen application is listed first.

In other words, I think that right-clicking on a .desktop file should give the same "Open with..." options as when right-clicking on a non-.desktop file. Granted, the underlying implementation might be notably different, because Gnome would have to look *inside* the .desktop file to get the mimetype instead of just examining the filename extension, but I can't imagine that doing so would be that difficult.