xdg-open doesn't use desktop file to open image/jpeg files

Bug #1395114 reported by Paulo Marcel Coelho Aragão
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xdg-utils (Ubuntu)
New
Undecided
Unassigned

Bug Description

xdg-open is not using the appropriate desktop file to open files with mimetype image/jpeg. Here's what it should use in my installation:

paulo@monk:~$ xdg-mime query default image/jpeg
geeqie.desktop

and here's the relevant section from /usr/share/applications/geeqie.desktop:

paulo@monk:~$ grep -i exec /usr/share/applications/geeqie.desktop
Exec=geeqie -r %F

I confirmed that there was no local geeqie.desktop:

paulo@monk:~$ ls ~/.local/share/applications/ | grep geeqie.desktop
paulo@monk:~$

However, I can see xdg-open is opening image/jpeg files by running:

geeqie %F

because geeqie doesn't dettach itself from the terminal, and this is the message it shows on the terminal:

paulo@monk:~/foto$ xdg-open 1ª\ comunhã.jpg
Could not init LIRC support

I can also see that Thunar uses the correct desktop file: if I click on a jpeg file inside Thunar, geeqie is started and dettaches itself, and the upstart log confirms that the geeqie.desktop Exec line was indeed called:

paulo@monk:~$ grep -i geeqie ~/.cache/upstart/startxfce4.log
Remote Geeqie not running, starting...Could not init LIRC support

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: xdg-utils 1.1.0~rc1-2ubuntu8
ProcVersionSignature: Ubuntu 3.16.0-24.32-generic 3.16.4
Uname: Linux 3.16.0-24-generic x86_64
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
CurrentDesktop: XFCE
Date: Fri Nov 21 16:50:20 2014
InstallationDate: Installed on 2014-11-21 (0 days ago)
InstallationMedia: Xubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
PackageArchitecture: all
SourcePackage: xdg-utils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Paulo Marcel Coelho Aragão (marcelpaulo) wrote :
Revision history for this message
Paulo Marcel Coelho Aragão (marcelpaulo) wrote :

Correcting myself: xdg-open IS using the correct desktop file for image/jpeg files, but it's getting the command name to exec and ignoring any other arguments present in the desktop file Exec field.

Revision history for this message
Paulo Marcel Coelho Aragão (marcelpaulo) wrote :

I've just discovered that xdg-open is not detecting xfce as the desktop, at this line:

elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;

As it doesn't detect the desktop, it uses open_generic_xdg_mime() which indeed picks up only the first word from Exec= in the desktop file. If the desktop were detected as xfce, it would have called exo-open which correctly uses the full Exec= command line. That's why Thunar was using the desktop file correctly because quite certainly it calls exo-open.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.