GNOME Bugzilla – Bug 749254
[Desktop Entry issue] Can't launch Type=Link icon
Last modified: 2018-05-24 17:50:15 UTC
I got some kind of test.desktop file like this [Desktop Entry] Version=1.0 Type=Link Encoding=UTF-8 Name=Launch Server Administrator Comment=Launch Server Administrator URL=https://localhost:1311 And I did "ln -s /usr/share/test.desktop ~/Desktop/b.desktop" in case that we can click the icon from gnome desktop. But while I double clicked the icon, it responds "There was an error launching the application" After some debugging, nautilus will warned this error while it got empty info from glib/gio/gdesktopappinfo.c. Glib only support Type=Application so it return appinfo=NULL to nautilus. So why glib does not support Type=Link as it is defined in freedesktop.org and in code?
->glib
In nautilus, especially in function activate_files() in nautilus-mime-action.c I can see if the launching .desktop file is a link, nautilus will call the glib function for the appinfo which will result in this issue. If it isn't, then nautilus will open the url in other application. From source code, I can see the action equals to ACTIVATION_ACTION_LAUNCH_DESKTOP_FILE (link file) and ACTIVATION_ACTION_OPEN_IN_APPLICATION (launch the original file) This judgment will lead the nautilus into different branches as I said before. This is all I know so far.
> So why glib does not support Type=Link as it is defined in freedesktop.org and > in code? GDesktopAppInfo is about applications. Type=Link and other such things are in the desktop entry spec mostly as historical accidents. Most of these other types are not useful. For you example, you can just make it a regular desktop file with Exec=firefox https://localhost:1311 and it will work.
(In reply to Matthias Clasen from comment #3) > > So why glib does not support Type=Link as it is defined in freedesktop.org and > in code? > > GDesktopAppInfo is about applications. Type=Link and other such things are > in the desktop entry spec mostly as historical accidents. Most of these > other types are not useful. > > For you example, you can just make it a regular desktop file with > > Exec=firefox https://localhost:1311 > > and it will work. During the debugging, I couldn't help agree with you. I thought if someone wants to use Type=Link file, he could totally use "Exec" instead. I was just wondering why upstream has defined this type but not realize it.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME'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.gnome.org/GNOME/glib/issues/1037.