Bug 99106 - xdg-mime defualt is inconsistent with xdg-open
Summary: xdg-mime defualt is inconsistent with xdg-open
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: 1.1.0 rc3
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Portland Bugs
QA Contact:
Depends on:
Reported: 2016-12-16 11:25 UTC by tezeb
Modified: 2019-02-16 13:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description tezeb 2016-12-16 11:25:49 UTC
Steps to reproduce:
1. DE set to gnome3
2. unset XDG_DATA_HOME
3. have multiple valid pdf applications installed(ie. gimp, evince)
4. assume no custom settings for handlers
5. run: xdg-mime query default application/pdf
With XDG_UTILS_DEBUG_LEVEL, it will display multiple paths being checked. It finds gimp.desktop in /usr/share/applications/defaults.list
6. run: xdg-mime default /usr/share/applications/evince.desktop application/pdf
Again, debug shows:
Updating /home/user/.local/share/applications/mimeapps.list
7. run: xdg-mime query default application/pdf
It displays '/usr/share/applications/evince.desktop' as expected.

8. run: xdg-open xxx.pdf
It opens gimp.desktop(or whatever was the default).

The BUG:
Internally xdg-open uses gvfs-open(version 1.30.3 here), which uses ~/.config/ as default XDG_DATA_HOME when the variable is unset, but xdg-mime uses some awk magic and completly different path.
Comment 1 layus 2017-03-06 11:11:21 UTC
It is even worse than that. reading and setting values does not occur in the same file:

$ XDG_UTILS_DEBUG_LEVEL=3 xdg-mime query default text/html
Checking /home/gmaudoux/.config/mimeapps.list

$ XDG_UTILS_DEBUG_LEVEL=3 xdg-mime default chromium-browser.desktop text/html
make_default_kde: No kde runtime detected
make_default_generic chromium-browser.desktop text/html
Updating /home/gmaudoux/.local/share/applications/mimeapps.list

$ XDG_UTILS_DEBUG_LEVEL=3 xdg-mime query default text/html
Checking /home/gmaudoux/.config/mimeapps.list
Comment 2 layus 2017-03-06 12:08:49 UTC
Oh, it seems this has been fixed in https://bugs.freedesktop.org/show_bug.cgi?id=95051. A new bugfix release for this ?
Comment 3 Rex Dieter 2017-03-07 13:15:54 UTC
ok, closing as dup

*** This bug has been marked as a duplicate of bug 95051 ***
Comment 4 tezeb 2017-03-07 14:05:29 UTC
Nice try... 
Still happens with patch from 95051 applied.
Have anyone even tested this?!!!!

The issue have to do with xdg-open, not only xdg-mime, which is clearly stated in reproduction step #7.
Comment 5 Rex Dieter 2017-03-07 14:12:52 UTC
sorry, misinterpreted comment #2 which claims that it is fixed
Comment 6 GitLab Migration User 2019-02-16 13:38:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/103.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.