On 01/14/2017 06:01 AM, Guenter Milde wrote:
On 2017-01-14, Pavel Sanda wrote:
Guenter Milde wrote:
A more general question to all developers:
When checking for default viewer/editor applications during (re)configure,
should LyX
a) prefer feature rich applications, or
b) prefer small and fast-starting applications.
As I don't see any obvious choice I would prefer
c) don't mess with the order unless something really buggy starts appearing
    (not so much because I believe the current order is right, but rather
    not to disturb people who are used to the current situation).
Yes, this is my conclusion as well.
We should put this off until xdg-mime is safe to use.

Günter

Is there any evidence that xdg-mime/xdg-open will ever be safe? Right now I see two problems with it, one of which can be avoided. The original show-stopper was that it defaulted to opening files in the web browser if no default application was set. We can work around that by using xdg-mime to test whether a default is set in the MIME database. If yes, we can make xdg-open the file handler; if not, we can do what we currently do.

The bigger problem, in my mind, is that xdg-mime sometimes finds a default application, but not the one actually used by the system. I mentioned this in an earlier message, after stumbling on it accidentally. I found xdg-open using a "stale" default from ~/.local/share/applications/mimeapps.list when the correct default was set in ~/.config/mimeapps.list. I haven't been able to locate any official document on the Freedesktop web site specifically naming the hierarchy of MIME database files, and I don't know enough to know whether ~/.config/mimeapps.list results from some applications not using the Freedesktop spec, or whether xdg is supposed to check that first but for some reason does not. In any case, unless my laptop is an outlier, there may be users out there for whom xdg-utils would select not the browser but some other incorrect (and, in one case on my laptop, not even installed) application.

Rather than waiting on xdg-utils to be fixed (if in fact Freedesktop even sees this as a bug -- I have no idea about that), should we look at gvfs-mime/gvfs-open (again with the stipulation that we first check whether a default application is set, and if not revert to our current practice)? It works on both my systems, but they're both running recent (albeit different) versions of Linux Mint. If we move in this direction, I think we should first ask devs with other Linux distributions to test it (which can be done with a simple shell script).

As far as standing pat, I can testify that this represents a PITA for Mint users once they upgrade to 18.1 (or maybe 18.0), because the X-Apps are not recognized and, depending on what else they have installed, they can end up with no viewers or gimp and notepad (WINE) as viewers. I have no idea whether any other distributions are going to move to X-Apps, so it may only be Mint users that are affected.

Incidentally, for people ill served by the configuration script, one way to reduce the pain would be to add something in the Tools > Preferences... dialogs that would allow the user, in one step, to set a new default viewer or editor for all file formats of a certain ilk (all PDF formats, all text formats, all image formats). Having to change the viewer for PDF (pdflatex) every time I reconfigure is mildly annoying; having to change it for multiple PDF formats after each reconfiguration is serious annoying.

One other thought came to mind: /if/ this is actually only a problem for Mint users, we could perhaps stick with the current configuration script and provide a separate configuration script that Mint users could download and install over the one that comes with the LyX package. That's essentially the workaround I'm using now.

Paul

Reply via email to