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 611569 - Nautilus window quits on unmounting [when partition is launched from places menu]
Nautilus window quits on unmounting [when partition is launched from places m...
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: general
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-02 09:08 UTC by Vish
Modified: 2012-10-26 19:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Keep single mount window open when unmounting (1.12 KB, patch)
2010-03-03 03:50 UTC, Luke Symes
none Details | Review
Implement "initiated_unmount" property for NautilusWindow (4.66 KB, patch)
2010-03-08 08:50 UTC, Luke Symes
reviewed Details | Review
Set "initiated_unmount" before removing a mount (5.43 KB, patch)
2010-03-08 08:51 UTC, Luke Symes
needs-work Details | Review
Don't call mount_removed_callback on "mount_pre_unmount" signal. (1.58 KB, patch)
2010-03-08 08:52 UTC, Luke Symes
needs-work Details | Review
Check for the initiated_unmount window property. (2.09 KB, patch)
2010-03-08 08:53 UTC, Luke Symes
needs-work Details | Review

Description Vish 2010-03-02 09:08:49 UTC
Steps to reproduce:
1: From Places > Select an unmounted partition
[nautilus window opens with the /media/partition ]

2: Now "unmount" the partition either using the unmount button or from the context menu.

Deviation:
Nautilus window just quits as the partition unmounts

Expected behavior:
The window needs to be redirected to computer://

This seems to be a side-effect of a fix for https://bugzilla.gnome.org/show_bug.cgi?id=591458
Earlier , the partition would just redirect to /media irrespective of where the partition was launched from.

Now , instead if the partition was mounted from the nautilus sidepane , the redirect to computer:// works as intended.[Also, if the partition is at some point selected in the sidepane this nautilus quitting does not happen]
Comment 1 Vish 2010-03-02 09:11:21 UTC
Bug first reported in lp: 
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/530542
Comment 2 Luke Symes 2010-03-03 03:50:35 UTC
Created attachment 155099 [details] [review]
Keep single mount window open when unmounting

The problem appears to be that all slots showing "mount contents only" are listed for closure. If you opened the mount folder directly (e.g. through Places) then that slot will be in the "close list" because its browse history only contains mount folders in it.
To remedy this, the patch adds a condition such that if the "close list" only contains one slot then that slot becomes the "force_no_close_slot". This means that there will always be at least one slot redirected to computer:///.
Comment 3 Luke Symes 2010-03-08 08:50:24 UTC
Created attachment 155531 [details] [review]
Implement "initiated_unmount" property for NautilusWindow

Windows will have "initiated_unmount" set to TRUE when one of their slots
initiates an unmount.
Comment 4 Luke Symes 2010-03-08 08:51:24 UTC
Created attachment 155532 [details] [review]
Set "initiated_unmount" before removing a mount
Comment 5 Luke Symes 2010-03-08 08:52:23 UTC
Created attachment 155533 [details] [review]
Don't call mount_removed_callback on "mount_pre_unmount" signal.

Previously, mount_removed_callback would be called on "mount_pre_unmount"
and on "mount_removed". It should only be called once so that we can
do property checks/resets once per mount.
Comment 6 Luke Symes 2010-03-08 08:53:31 UTC
Created attachment 155534 [details] [review]
Check for the initiated_unmount window property.

If a window has initiated_unmount, it's slots will never be closed.
Also, if none of our windows have initiated_unmount, don't close anything.
Comment 7 Alexander Larsson 2010-03-08 10:09:46 UTC
Thats still not quite right. 

First of all we must handle pre_unmount as closing these windows may be important for allowing the unmount to succeed (since e.g. a watch could be holding the directory open).

Secondly, its not safe to do the unsetting of initiated_unmount in the "detected an unmount" callback, since this is called for any kind of unmount (for example other unmounts going on in parallel) and its not always called (for instance if the unmount operation failed.

Instead we much unset it in the callback from the unmount operation.
Comment 8 Alexander Larsson 2010-03-08 10:12:38 UTC
This seems wrong too: 

> Also, if none of our windows have initiated_unmount, don't close anything.

At least its not an obviously right change in behaviour.
Comment 9 Cosimo Cecchi 2010-07-04 14:00:47 UTC
Setting fields according to Alexander's review.
Comment 10 Sebastien Bacher 2011-11-30 13:44:57 UTC
the issue is still there in GNOME 3.2
Comment 11 Cosimo Cecchi 2012-10-26 19:13:13 UTC
I believe this works correctly in git master (and gnome-3-6) after these fixes [1] [2].

The patches also don't apply anymore, as the code changed considerably in the meantime.

Closing as OBSOLETE, feel free to reopen in case I missed something.

[1] http://git.gnome.org/browse/nautilus/commit/?id=6d0a7e059207000307acaf96ec2c44196266f115
[2] http://git.gnome.org/browse/nautilus/commit/?id=3891241ba760c59d284b7579dbd340651c8d4d29