GNOME Bugzilla – Bug 598554
"Blank CD-R Disc" dialog shows an "unmount" button instead of "Eject"
Last modified: 2010-04-14 09:16:58 UTC
this report has been filed here: https://bugs.edge.launchpad.net/ubuntu/+source/nautilus/+bug/425104 "With GNOME 2.26 when the "detected a blank CD-ROM in your drive" message comes up it features a big "Eject" button at the bottom left corner with an appropriate graphic. The same dialog in 2.28 offers a cryptic "Unmount" option with not graphical hint as to what it means (see attached screenshot). The new behavior is less understandable to human beings." http://launchpadlibrarian.net/31385811/Screenshot-Blank%20CD-R%20Disc.png
-> gvfs The code in Nautilus is really simple (nautilus-autorun.c:1016): if (g_mount_can_eject (mount)) { /* code to use an "Eject" button */ } else { /* code to use an "Unmount" button */ } and seems to be untouched from 2.26. I guess the bug here is either in the GVfs DeviceKit backend or in DeviceKit-disks/libgdu itself, which return FALSE for g_mount_can_eject(), while the old HAL backend used to return TRUE.
This doesn't just affect the media dialog, also the right-click menu. I get the same here with a blank CD: Volume(1): Leere CD-R Type: GProxyVolume (GProxyVolumeMonitorGdu) ids: unix-device: '/dev/sr0' themed icons: [media-optical-cd-r] [media-optical-cd] [media-optical] [media] can_mount=1 can_eject=0 should_automount=0 Mount(0): Leere CD-R -> burn:/// Type: GProxyMount (GProxyVolumeMonitorGdu) default_location=burn:/// themed icons: [media-optical-cd-r] [media-optical-cd] [media-optical] [media] x_content_types: x-content/blank-cd can_unmount=1 can_eject=0 is_shadowed=0
*** Bug 600274 has been marked as a duplicate of this bug. ***
Hm, I'm trying to make some sense of this .. but it seems that neither g_proxy_volume_can_eject() nor g_gdu_volume_can_eject() are _ever_ called, neither on initialization nor on gvfs-mount -li (which does display the can_eject property).
Ah, I'm a step further. g_proxy_volume_can_eject() usually asks the corresponding drive for g_drive_can_eject(), but proxy_volume->drive_id is "" for the burn:/// volume.
The empty drive_id is actually not that surprising, since the CD drive disappears as soon as there's a burn volume for it. Empty drive: Drive(0): CD/DVD-Laufwerk Type: GProxyDrive (GProxyVolumeMonitorGdu) With blank CD-R: Volume(0): Leere CD-R Type: GProxyVolume (GProxyVolumeMonitorGdu) Since the Drive doesn't disappear with audio or data CDs, it seems to me that the disappearing drive for burn:// volumes is the root cause here?
For the record, this is what gvfs-mount -oi says when I insert a blank CD: Drive changed: 'CD/DVD-Laufwerk' Drive(0): CD/DVD-Laufwerk Type: GProxyDrive (GProxyVolumeMonitorGdu) ids: unix-device: '/dev/sr0' themed icons: [drive-optical] [drive] is_media_removable=1 has_media=1 is_media_check_automatic=1 can_poll_for_media=1 can_eject=1 can_start=0 can_stop=1 start_stop_type=shutdown Drive disconnected: 'CD/DVD-Laufwerk' Drive(0): CD/DVD-Laufwerk Type: GProxyDrive (GProxyVolumeMonitorGdu) ids: unix-device: '/dev/sr0' themed icons: [drive-optical] [drive] is_media_removable=1 has_media=1 is_media_check_automatic=1 can_poll_for_media=1 can_eject=1 can_start=0 can_stop=1 start_stop_type=shutdown (gvfs-mount:5906): GVFS-RemoteVolumeMonitor-DEBUG: g_proxy_volume_update: id = '(null)', uri = '', drive_id = '' Volume added: 'Leere CD-R' Volume(0): Leere CD-R Type: GProxyVolume (GProxyVolumeMonitorGdu) ids: unix-device: '/dev/sr0' themed icons: [media-optical-cd-r] [media-optical-cd] [media-optical] [media] (gvfs-mount:5906): GVFS-RemoteVolumeMonitor-DEBUG: g_proxy_volume_can_mount() can_mount=1 (gvfs-mount:5906): GVFS-RemoteVolumeMonitor-DEBUG: g_proxy_volume_can_eject() can_eject=0 should_automount=0 Mount added: 'Leere CD-R' Mount(0): Leere CD-R -> burn:/// Type: GProxyMount (GProxyVolumeMonitorGdu) default_location=burn:/// themed icons: [media-optical-cd-r] [media-optical-cd] [media-optical] [media] x_content_types: x-content/blank-cd (gvfs-mount:5906): GVFS-RemoteVolumeMonitor-DEBUG: g_proxy_mount_can_unmount(0x1dfc490): 1 can_unmount=1 can_eject=0 is_shadowed=0
Ah, I got it. While there is no media, should_drive_be_ignored() finds no volumes and thus doesn't ignore /dev/sr0. But as soon as there's media, there is a volume which is ignored due to an empty type/usage: (process:15535): GVFS-Gdu-DEBUG: should_drive_be_ignored: /dev/sr0 (process:15535): GVFS-Gdu-DEBUG: should_volume_be_ignored(/dev/sr0): usage '', type '' (process:15535): GVFS-Gdu-DEBUG: should_volume_be_ignored: result 1 (process:15535): GVFS-Gdu-DEBUG: should_drive_be_ignored: result: 1 (I added a few g_debug()s)
Created attachment 158696 [details] [review] Do not ignore CD drives with blank media Now the patch is quite simple and straightforward. Working perfectly now, Eject is now in the menu. Together with the patch in bug 598690 the "unmount" disappears as well. I think without that patch Unmount will still appear for the "blank CD" icon, though.
Looks good to me.
Thanks for the fast review! Pushed.