Dash does not handle .desktop files correctly if there are hyphens in the directory path

Bug #1582433 reported by Neil McPhail
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unity-lens-applications (Ubuntu)
Fix Released
Low
Andrea Azzarone
Xenial
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

The Unity dash can fail to display the icon or title from a .desktop file correctly if it resides under a directory containing a hyphen character.

[Test case]

As an example (on my 16.04 machine):

$ cat << EOF > test.desktop
[Desktop Entry]
Name=Hyphen test
Exec=/bin/true
Type=Application
Icon=/usr/share/icons/suru/apps/256/dash.png
EOF

$ chmod +x test.desktop
$ mkdir ~/.local/share/applications/hyphen-test
$ mv test.desktop ~/.local/share/applications/hyphen-test/

Now, open the dash and search for "hyphen". On my machine, I see the correct icon but no title is displayed underneath.

$ mv ~/.local/share/applications/hyphen-test ~/.local/share/applications/hyphen

Searching for "hyphen" in the dash now shows an entry with the correct icon and title (but also still shows the defunct previous entry without title).

The effect of the hyphenated path seems variable. Some apps show the wrong icon, some have a missing title, some have both errors.

The problem only seems to be with hyphens in the directories. Hyphens in the file itself are fine. See the screenshot - Might and Magic 4&5 has had a desktop file installed under a subdirectory with a hyphen, whereas Heroes of Might and Magic has a desktop file in the root directory but contains a hyphen in the filename. The latter is shown correctly, but the desktop files in the former directory are not shown properly.

[Possible Regressions]
Nothing known.

Revision history for this message
Neil McPhail (njmcphail) wrote :
Andrea Azzarone (azzar1)
Changed in unity (Ubuntu):
importance: Undecided → Low
assignee: nobody → Andrea Azzarone (azzar1)
Andrea Azzarone (azzar1)
tags: added: desktop-trello-import
Changed in unity (Ubuntu):
status: New → Triaged
Revision history for this message
Will Cooke (willcooke) wrote : Automatically added comment
tags: removed: desktop-trello-import
Andrea Azzarone (azzar1)
Changed in unity (Ubuntu):
status: Triaged → In Progress
Andrea Azzarone (azzar1)
Changed in unity-lens-applications (Ubuntu):
status: New → In Progress
assignee: nobody → Andrea Azzarone (azzar1)
importance: Undecided → Low
Andrea Azzarone (azzar1)
no longer affects: unity (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-lens-applications - 7.1.0+16.10.20160602-0ubuntu1

---------------
unity-lens-applications (7.1.0+16.10.20160602-0ubuntu1) yakkety; urgency=medium

  [ Andrea Azzarone ]
  * Fallback from pkginfo.application_name in case app is NULL. (LP:
    #1582433)

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Thu, 02 Jun 2016 01:01:00 +0000

Changed in unity-lens-applications (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

Trusty is also affected. Please backport to 14.04 LTS.

tags: added: trusty xenial
Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

I'm having this bug in Trusty.

Andrea Azzarone (azzar1)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Neil, or anyone else affected,

Accepted unity-lens-applications into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unity-lens-applications/7.1.0+16.04.20160701-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in unity-lens-applications (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
tags: added: verification-done
removed: verification-needed
Revision history for this message
Neil McPhail (njmcphail) wrote :

Thanks for your work on this, but I'm not sure it is fixed 100% yet. For example:

$ cat ~/.local/share/applications/wine/Programs/GOG.com/Might\ and\ Magic\ 4-5/Might\ and\ Magic\ 4-5\ -\ World\ of\ Xeen\ \(Full\ Speech\).desktop
[Desktop Entry]
Name=Might and Magic 4-5 - World of Xeen (Full Speech)
Exec=env WINEPREFIX="/home/neil/games/mm45/wine" wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/neil/games/mm45/wine/dosdevices/c:/users/Public/Start\\ Menu/Programs/GOG.com/Might\\ and\\ Magic\\ 4-5/Might\\ and\\ Magic\\ 4-5\\ -\\ World\\ of\\ Xeen\\ \\(Full\\ Speech\\).lnk
Type=Application
StartupNotify=true
Path=/home/neil/games/mm45/wine/dosdevices/c:/GOG Games/Might and Magic 4-5/DOSBOX
Icon=C399_goggame-1207661233.0

$ ag -g C399_goggame-1207 ~/.local/share/
/home/neil/.local/share/icons/hicolor/48x48/apps/C399_goggame-1207661233.0.png
/home/neil/.local/share/icons/hicolor/256x256/apps/C399_goggame-1207661233.0.png
/home/neil/.local/share/icons/hicolor/16x16/apps/C399_goggame-1207661233.0.png
/home/neil/.local/share/icons/hicolor/32x32/apps/C399_goggame-1207661233.0.png

But the correct icon does not show. Instead, I get the generic "toolbox" icon as per screenshot attached. Oddly enough, my testcase in the original posting does display the correct icon. Perhaps this is because I specify the full path?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-lens-applications - 7.1.0+16.04.20160701-0ubuntu1

---------------
unity-lens-applications (7.1.0+16.04.20160701-0ubuntu1) xenial; urgency=medium

  [ Andrea Azzarone ]
  * Fallback from pkginfo.application_name in case app is NULL. (LP:
    #1582433)

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Fri, 01 Jul 2016 10:44:01 +0000

Changed in unity-lens-applications (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for unity-lens-applications has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.