After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705166 - g_mount_get_icon() does not always return correct icon
g_mount_get_icon() does not always return correct icon
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-07-30 19:17 UTC by Kip
Modified: 2018-05-24 15:34 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kip 2013-07-30 19:17:37 UTC
I've consulted with the folks at xdg@lists.freedesktop.org and determined that apparently there is a way to provide a custom icon on mounted volumes in a fd.o friendly way. Mikkel on unity-devel informed me that most desktop environments are probably using glib's g_mount_get_icon() to retrieve this icon. However, I haven't really found a desktop environment that this works properly on so far. This may be because g_mount_get_icon() is used correctly, but not actually returning the correct icon when a custom one was provided.

Using a custom icon on a mounted volume can apparently be done in a fd.o friendly manner by providing a ".directory" file (note only an extension and no leading file name) in the root of the mounted volume. This is a standard Desktop Entry file with the Icon field set to some icon and probably with Type=Directory set.

If the problem is just with g_mount_get_icon(), then theoretically patching this GIO function should enable all desktop environments dependent on it to use the custom icon (e.g. Unity, Gnome, Xfce, etc.).
Comment 1 Matthias Clasen 2013-08-04 15:48:45 UTC
A quick look at the gvfs code seemed to point at two ways for adding custom icons for a mounted volume:

1) https://bugzilla.gnome.org/show_bug.cgi?id=551403 explains .xdg-volume-info

2) https://git.gnome.org/browse/gvfs/tree/monitor/udisks2/what-is-shown.txt?id=bb4e7ed0236855d2ced7cfd4445877822da8fe7b for information about mount options and udev properties to set icons
Comment 2 Kip 2013-08-06 06:54:14 UTC
Hey Matthias. Thanks for sharing. I took a look at both links and I am still confused. I still don't really understand what the .xdg-volume-info file is for. Is this a replacement for the .directory method?

As for the latter link, I still don't understand how a removable media can specify its own custom icon.
Comment 3 GNOME Infrastructure Team 2018-05-24 15:34:03 UTC
-- 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/738.