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 597802 - Multiple icons
Multiple icons
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: afc backend and volume monitor
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-08 13:25 UTC by David Zeuthen (not reading bugmail)
Modified: 2009-11-15 12:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix shadowed mount showing up next to existing volume icon (2.22 KB, patch)
2009-11-14 22:09 UTC, Martin Szulecki
none Details | Review
Fix shadowed mount showing up next to existing volume icon (2.21 KB, patch)
2009-11-15 00:44 UTC, Martin Szulecki
committed Details | Review

Description David Zeuthen (not reading bugmail) 2009-10-08 13:25:51 UTC
See http://people.freedesktop.org/~david/afc-dot-misc.png

$ gvfs-mount -li
Drive(0): 80 GB Solid-State Disk
  Type: GProxyDrive (GProxyVolumeMonitorGdu)
  ids:
   unix-device: '/dev/sda'
  themed icons:  [drive-harddisk-ata]  [drive-harddisk]  [drive]
  is_media_removable=0
  has_media=1
  is_media_check_automatic=0
  can_poll_for_media=1
  can_eject=0
  can_start=0
  can_stop=0
  start_stop_type=unknown
  Volume(0): EXTblah
    Type: GProxyVolume (GProxyVolumeMonitorGdu)
    ids:
     uuid: '7806d3a4-6da2-48ff-b673-c23e6830aa66'
     unix-device: '/dev/sda2'
     label: 'EXTblah'
    themed icons:  [drive-harddisk-ata]  [drive-harddisk]  [drive]
    can_mount=1
    can_eject=0
    should_automount=0
  Volume(1): FOOBAR2
    Type: GProxyVolume (GProxyVolumeMonitorGdu)
    ids:
     uuid: '9FA0-1696'
     unix-device: '/dev/sda3'
     label: 'FOOBAR2'
    themed icons:  [drive-harddisk-ata]  [drive-harddisk]  [drive]
    can_mount=1
    can_eject=0
    should_automount=0
Volume(0): iPhone
  Type: GProxyVolume (GProxyVolumeMonitorGPhoto2)
  ids:
   unix-device: '/dev/bus/usb/001/020'
  activation_root=gphoto2://[usb:001,020]/
  themed icons:  [camera-photo]
  can_mount=1
  can_eject=0
  should_automount=1
  Mount(0): iPhone -> gphoto2://[usb:001,020]/
    Type: GProxyShadowMount (GProxyVolumeMonitorGPhoto2)
    themed icons:  [camera-photo]
    x_content_types: x-content/image-dcf
    can_unmount=1
    can_eject=0
    is_shadowed=0
Volume(1): David Zeuthen’s iPhone
  Type: GProxyVolume (GProxyVolumeMonitorAfc)
  ids:
   uuid: 'a1f47b63bae8bae2bb5aa3d59b8b4c38627e738e'
  uuid=a1f47b63bae8bae2bb5aa3d59b8b4c38627e738e
  activation_root=afc://a1f47b63bae8bae2bb5aa3d59b8b4c38627e738e/
  themed icons:  [phone-apple-iphone]  [phone-apple]  [phone]
  can_mount=1
  can_eject=0
  should_automount=1
  Mount(0): David Zeuthen’s iPhone -> afc://a1f47b63bae8bae2bb5aa3d59b8b4c38627e738e/
    Type: GProxyShadowMount (GProxyVolumeMonitorAfc)
    themed icons:  [phone-apple-iphone]  [phone-apple]  [phone]
    can_unmount=1
    can_eject=0
    is_shadowed=0
Mount(0): sftp for david on people.freedesktop.org -> sftp://david@people.freedesktop.org/
  Type: GDaemonMount
  themed icons:  [folder-remote]  [folder]
  can_unmount=1
  can_eject=0
  is_shadowed=0
Mount(1): iPhone -> gphoto2://[usb:001,020]/
  Type: GDaemonMount
  themed icons:  [camera-photo]  [camera]
  x_content_types: x-content/image-dcf
  can_unmount=1
  can_eject=0
  is_shadowed=1
Mount(2): David Zeuthen’s iPhone -> afc://a1f47b63bae8bae2bb5aa3d59b8b4c38627e738e/
  Type: GDaemonMount
  themed icons:  [phone-apple-iphone]  [phone-apple]  [phone]
  can_unmount=1
  can_eject=0
  is_shadowed=1
Comment 1 Bastien Nocera 2009-10-08 13:36:22 UTC
Can't reproduce here.

The "Mount(2)" is shadowed, so shouldn't appear.
Comment 2 Martin Szulecki 2009-11-01 18:13:34 UTC
I can reproduce this finally.
On the second plug-in of the device, two icons show up.
Mount(2) infact shows up despite being marked as "is_shadowed".

Must check GVFS now why it still displays...
Comment 3 Bastien Nocera 2009-11-02 04:44:26 UTC
It's actually up to the front-ends to determine whether or not to show a mount. My guess is that the property value is only changed after the mount is created, causing problems in the front-ends.

Best would probably be to use gvfs-mount's --monitor functionality to see what the volume monitor does.
Comment 4 Martin Szulecki 2009-11-03 17:01:12 UTC
Ok, checked it with "gvfs-mount -o -i":

---

Volume added:       'Mr’s iPhone'
  Volume(0): Mr’s iPhone
    Type: GProxyVolume (GProxyVolumeMonitorAfc)
    ids:
     uuid: 'ae47*********************************'
    uuid=ae47*********************************
    themed icons:  [phone-apple-iphone]  [phone-apple]  [phone]
    can_mount=1
    can_eject=0
    should_automount=1

Mount added: 'Mr’s iPhone'
  Mount(0): Mr’s iPhone -> afc://ae47*********************************/
    Type: GDaemonMount
    themed icons:  [phone-apple-iphone]  [phone-apple]  [phone]
    can_unmount=1
    can_eject=0
    is_shadowed=0

---

Note "is_shadowed=0". No further event for other afc mounts.

First the volume appears in "nautilus computer:///", a second later the mount appears like noted above.

The same happens in the libgphoto backend, however I noticed that in contrast to the afc backend, the monitor shows "Mount changed" for the gphoto events where "is_shadowed" is toggled to "1".

Now, running "gvfs-mount -li" afterwards, shows the Volume(0), Mount(0) and a Mount(3) which has "is_shadowed=1":

--- 

Volume(1): Mr’s iPhone
  Type: GProxyVolume (GProxyVolumeMonitorAfc)
  ids:
   uuid: 'ae47*********************************'
  uuid=ae47*********************************
  activation_root=afc://ae47*********************************/
  themed icons:  [phone-apple-iphone]  [phone-apple]  [phone]
  can_mount=1
  can_eject=0
  should_automount=1
  Mount(0): Mr’s iPhone -> afc://ae47*********************************2/
    Type: GProxyShadowMount (GProxyVolumeMonitorAfc)
    themed icons:  [phone-apple-iphone]  [phone-apple]  [phone]
    can_unmount=1
    can_eject=0
    is_shadowed=0
Mount(2): iPhone -> gphoto2://[usb:001,015]/
  Type: GDaemonMount
  themed icons:  [camera-photo]  [camera]
  x_content_types: x-content/image-dcf
  can_unmount=1
  can_eject=0
  is_shadowed=1
Mount(3): Mr’s iPhone -> afc://ae47*********************************/
  Type: GDaemonMount
  themed icons:  [phone-apple-iphone]  [phone-apple]  [phone]
  can_unmount=1
  can_eject=0
  is_shadowed=1

---
Comment 5 Bastien Nocera 2009-11-05 23:35:42 UTC
Nikias found the bug, it was in libusbmuxd.
Comment 6 Martin Szulecki 2009-11-14 17:17:10 UTC
Unfortunately this is not fixed by the libusbmuxd change (same for Nikias).
I can't reopen the bug though.
Comment 7 Martin Szulecki 2009-11-14 21:02:01 UTC
Ok, I have done some investigation into this and I think found the issue.

The problem is that the activation_root is not set early enough in the GvfsAfcVolume constructor and thus NULL is returned for the mount.

As the activation_root uri's don't match, it appears two icons are created.

I quickly cooked up something to do it exactly like the gphoto2 backend does and have the activation_root set in the constructor.

Suddenly the icon in the GTK+ dialogs was browsable for me aswell as nautilus correctly listing one icon with alterating mount/unmount context items all the time. Another effect was that the "Choose Application/Perform Action" dialog suddenly showed up again aswell as it should.

Does that sound reasonable?
Comment 8 Martin Szulecki 2009-11-14 22:09:12 UTC
Created attachment 147747 [details] [review]
Fix shadowed mount showing up next to existing volume icon

The activation_root for a volume was not set when queried and thus
causing two icons created for the same volume/mount.

Now it already sets the activiation_root in the volume constructor
like in the gphoto2 backend.

Please test/give feedback.
Comment 9 Bastien Nocera 2009-11-15 00:18:35 UTC
+  g_object_set_data_full (G_OBJECT(self), "root", g_object_ref (root), g_object_unref);
This should be:
+  g_object_set_data_full (G_OBJECT(self), "root", root, g_object_unref);

as the newly created "root" GFile should only have one reference when attached to the "self" object (so it's correctly finalized/had its last reference dropped when "self" is unref'ed).

Other than that, looks good to me.
Comment 10 Martin Szulecki 2009-11-15 00:44:57 UTC
Created attachment 147750 [details] [review]
Fix shadowed mount showing up next to existing volume icon

Thanks for spotting, fixed it.