.desktop files in .local/share/applications not processed correctly

Bug #1370190 reported by teo1978
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity
New
Undecided
Unassigned
unity (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I had this file: ~/.local/share/applications/jetbrains-android-studio.desktop

whose content is:
-----
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Android Studio (Preview) 0.4.6
Icon=jetbrains-android-studio.png
Path=/home/teo/
#Exec=/usr/lib/jvm/java-7-oracle/bin/java -Xms128m -Xmx750m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=96m -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Didea.project.structure.max.errors.to.show=0 -XX:+UseCodeCacheFlushing -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:+HeapDumpOnOutOfMemoryError -Dawt.useSystemAAFontSettings=lcd -Djb.vmOptionsFile=Documents/programmi/android-studio/bin/studio64.vmoptions -Xbootclasspath/a:Documents/programmi/android-studio/bin/../lib/boot.jar -Didea.paths.selector=AndroidStudioPreview -Didea.platform.prefix=AndroidStudio -Djb.restart.code=88 com.intellij.idea.Main
Exec=/home/teo/Documents/programmi/android-studio/bin/studio.sh
StartupNotify=false
#StartupWMClass=jetbrains-android-studio
OnlyShowIn=Unity;
X-UnityGenerated=true
-----

I wanted to use this as a model for creating a desktop file for a completely unrelated application. So this is what I did:

I copied the file verbatim to ~/.local/share/applications/telegram.desktop

and then edited it. Its content now is:

-----
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Telegram Desktop
Path=/home/teo/
Exec=/home/teo/Documents/programmi/Telegram/Telegram
StartupNotify=true
OnlyShowIn=Unity;
X-UnityGenerated=true
-----

You can see that there's absolutely nothing in the first file that matches the string "telegram", and also you can see that the second file (the one called "telegram.desktop") has "Telegram Desktop" as its application name, NOT Android Studio, and doesn't contain anything related to "Android Studio".

So, the expected behavior is that if I type "Telegram" in the Dash, an item should be displayed under Applications, with the name Telegram Desktop, and with either the default icon embedded in the executable, if any, or some default icon.

Instead, I get this: see screenshot.

It looks like the list of applications got somehow "cached" when I created the new file, but it didn't get updated when I modified the file.

If I click on the wrongly-named "Android Studio (etc)" application, it does load the correct one, which is Telegram.

Perhaps this will be fixed at the next reboot, but it shouldn't take a reboot.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: unity 7.2.2+14.04.20140714-0ubuntu1.1
ProcVersionSignature: Ubuntu 3.13.0-34.60-generic 3.13.11.4
Uname: Linux 3.13.0-34-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CurrentDesktop: Unity
Date: Tue Sep 16 19:44:17 2014
InstallationDate: Installed on 2013-10-11 (340 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
SourcePackage: unity
UpgradeStatus: Upgraded to trusty on 2014-05-24 (115 days ago)

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
Neil McPhail (njmcphail) wrote :

This bug seems to be related to paths under ~/.local/share/applications which have hyphens in the directory path. This seems to cause corruption of the icon parsing or title which is displayed in the dash. 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.

Revision history for this message
Neil McPhail (njmcphail) wrote :

The problem inly 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.

Revision history for this message
teo1978 (teo8976) wrote :

In my case there were no hyphens in the directories, only in the filename. And by the way it did get fixed after reboot. I'm not even convinced the dashes has anything to do, but who knows.

Revision history for this message
Neil McPhail (njmcphail) wrote :

Sorry - I misread that in the original post. My eyesight fails me again!

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.