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 598554 - "Blank CD-R Disc" dialog shows an "unmount" button instead of "Eject"
"Blank CD-R Disc" dialog shows an "unmount" button instead of "Eject"
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: [obsolete] gdu volume monitor
1.4.x
Other Linux
: Normal minor
: ---
Assigned To: gvfs-maint
gvfs-maint
: 600274 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-10-15 13:12 UTC by Pedro Villavicencio
Modified: 2010-04-14 09:16 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
Do not ignore CD drives with blank media (1.56 KB, patch)
2010-04-14 08:49 UTC, Martin Pitt
none Details | Review

Description Pedro Villavicencio 2009-10-15 13:12:30 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
Comment 1 Cosimo Cecchi 2009-10-18 15:03:11 UTC
-> 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.
Comment 2 Martin Pitt 2010-04-13 12:50:40 UTC
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
Comment 3 Martin Pitt 2010-04-13 12:50:52 UTC
*** Bug 600274 has been marked as a duplicate of this bug. ***
Comment 4 Martin Pitt 2010-04-13 15:47:24 UTC
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).
Comment 5 Martin Pitt 2010-04-14 06:56:13 UTC
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.
Comment 6 Martin Pitt 2010-04-14 07:12:06 UTC
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?
Comment 7 Martin Pitt 2010-04-14 08:05:00 UTC
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
Comment 8 Martin Pitt 2010-04-14 08:35:24 UTC
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)
Comment 9 Martin Pitt 2010-04-14 08:49:39 UTC
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.
Comment 10 Bastien Nocera 2010-04-14 09:04:10 UTC
Looks good to me.
Comment 11 Martin Pitt 2010-04-14 09:16:58 UTC
Thanks for the fast review! Pushed.