GNOME Bugzilla – Bug 552168
volume's mount not mounted after g_volume_mount_finish()
Last modified: 2008-09-29 17:43:50 UTC
When you click on an unmounted volume, it should mount it (as it does) and then show it. Instead the selection reverts back to the current location and the contents don't change until you click the volume a second time. Other information: Forwarded from https://bugs.launchpad.net/bugs/269901 : "When you click a place on nautilus' places sidebar, you're taken to it. Volumes, however, seem to work differently. If you click once on an unmounted volume you're asked for permission (password) to mount it, but nothing else happens. You have to click it once again for nautilus to actually display it."
Reassigning to gvfs. David: Nautilus uses g_volume_mount(), in libnautilus-private/nautilus-file-operations.c:nautilus_file_operations_mount_volume_full(). After finishing the mount in the libnautilus-private/nautilus-file-operations.c:volume_mount_cb() callback we proxy to another callback. In this case, it's src/nautilus-places-sidebar.c:volume_mounted_cb(). Unfortunately, directly after finishing the mount, g_volume_get_mount (volume) seems to return NULL, and we used it for going to the mount's root location. I think this happened when the volume monitor moved out-of-process. Is this by design - i.e. should we wait for “mount-added” - or is it a gvfs regression?
Actually reassigning to gvfs, changing title.
(In reply to comment #1) > Unfortunately, directly after finishing the mount, g_volume_get_mount (volume) > seems to return NULL, and we used it for going to the mount's root location. I > think this happened when the volume monitor moved out-of-process. Is this by > design - i.e. should we wait for “mount-added” - or is it a gvfs > regression? Yeah, probably g_volume_get_mount() should return non-NULL after calling g_volume_mount_finish() and not getting an error... Do you get the mount-added signal though? And if so, does g_volume_get_mount() return something non-NULL?
The same problem can now be seen in the file chooser.
I'll work on a fix over the weekend; ping me Monday if there isn't a patch yet.
Will also check/fix the other volume monitors (gphoto2, daemon, unix). Also, we want a fix for the docs g_volume_mount() to specify this behavior (today it's undefined).
I can't seem to reproduce this problem with gvfs trunk... any hints on how to reproduce it? Thanks.
Actually I can reproduce this just fine now (funny thing is that it's fine on the daemon side; not so on the proxy side) so disregard comment 7. Working on a fix.
Created attachment 119598 [details] [review] patch that was committed OK, so we actually did handle this; unfortunately the mount-added signal was emitted in idle so the D-Bus message resulting from this was sent after the reply for the Mount method. Am pretty sure we should remove all locking from the hal volume monitor now that it runs in a separate daemon. Anyway, committed the attached patch. 2008-09-29 David Zeuthen <davidz@redhat.com> * monitor/hal/ghalvolume.c: * monitor/hal/ghalvolumemonitor.[ch]: Make sure we emit 'mount-added' when forcing an update for completing a mount operation (#552168)
Please reopen if the fix doesn't work - it works for me.
Created attachment 119600 [details] [review] doc patch for gio Matthias, here's a patch for gio clarifying the docs
I deleted a bit too much when cleaning up the patch; also need this patch http://svn.gnome.org/viewvc/gvfs/trunk/monitor/proxy/gproxyvolume.c?r1=1931&r2=2037 Committed. 2008-09-29 David Zeuthen <davidz@redhat.com> * monitor/proxy/gproxyvolume.c (mount_cb): Complete the mounting operation in idle to ensure we've processed pending dbus messages for creating the new mount object
Doc addition looks fine to me, please commit
gvfs fixes also now committed on the gnome-2-24 branch: 2008-09-29 David Zeuthen <davidz@redhat.com> * monitor/hal/ghalvolume.c: * monitor/hal/ghalvolumemonitor.[ch]: * monitor/proxy/gproxyvolume.c: Make sure we emit 'mount-added' when forcing an update for completing a mount operation (#552168). Cherry-picked from trunk.
(In reply to comment #13) > Doc addition looks fine to me, please commit Committed on trunk. Thanks.