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 318094 - Nautilus windows should close on unmount
Nautilus windows should close on unmount
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Navigation
2.23.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 466719 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-10-06 09:30 UTC by Daniel Holbach
Modified: 2010-02-22 13:20 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Fixes existing check for if window should be closed. (1.56 KB, patch)
2010-02-16 22:01 UTC, Luke Symes
committed Details | Review

Description Daniel Holbach 2005-10-06 09:30:26 UTC
Distribution/Version: Ubuntu Breezy

Forwarded from http://bugzilla.ubuntu.com/show_bug.cgi?id=17115

http://bugzilla.ubuntu.com/show_bug.cgi?id=17115
Comment 1 Daniel Holbach 2005-10-06 12:33:47 UTC
(Sorry for forgetting the actual text... OUCH):

(This is not a bug, but a wishlist item)

When a removable device is unmounted (cdrom, etc.), all nautilus windows
displaying it are reset to my home directory, cluttering up my taskbar/desktop
after working with several cdroms.
I would find it nicer if they would disappear if their root directory was within
the unmounted filesystem.

Regards

Martin emrich
Comment 2 Teppo Turtiainen 2005-12-23 20:28:20 UTC
Confirmed with Nautilus 2.12.1 on Ubuntu Breezy.
Comment 3 Sebastien Bacher 2006-03-29 10:53:04 UTC
Works fine with dapper, I'm closing the bug. Feel free to reopen if you still get he issue
Comment 4 Teppo Turtiainen 2006-03-31 04:30:06 UTC
This still happens to me on a fully updated Dapper.
Comment 5 Martin Emrich 2007-02-08 01:13:13 UTC
I just tried this after a long time on Ubuntu feisty (Gnome 2.17.90):

- mounted some remote folder via SSH/gnome-vfs
- opened it
- unmounted it

The Window still snaps back to my home directory.

Ciao

Martin
Comment 6 Martin Emrich 2007-06-06 08:13:59 UTC
Still here with 2.18.1

Ciao

Martin
Comment 7 Pablo Castellano (IRC: pablog) 2008-09-14 19:13:24 UTC
Still here with 2.22.3
Comment 8 Christian Neumair 2008-09-16 08:43:10 UTC
The “go to home” policy has been introduced deliberately. Closing a window would lose its entire history, and you may go back to a location that is not on the disk. Especially in the case of remote mounts, where re-trying to open a remote location will lead to a re-mount attempt. The unmount might have happened accidentally, because the cable was pulled out or something.

On the other hand, I understand that the basic problem

put disc into drive with automount enabled => window pops up
eject disc => window goes to home

is very unintuitive.

What about the following agreement: When ejecting a medium, if a window was opened due to automount, only displayed locations on the mounted disk, and it is not the last displayed window, then close it. Otherwise go to home.
Comment 9 Cosimo Cecchi 2009-03-19 18:13:34 UTC
*** Bug 466719 has been marked as a duplicate of this bug. ***
Comment 10 John Meuser 2009-12-15 21:26:28 UTC
This has always been a pet peeve of mine with Nautilus.  It seems that the biggest opposition to this bug is that history is lost if you close the window.  I have a simple proposition:

If there is no history for that window/tab, close it.
If there is, go back in history until you reach a point that is not under the removed media's root.
If no point in history is not under the removed media's root, then the window/tab now has no use, and should be removed.

It seems that GVFS already behaves similarly to this.  The only difference is that if there is history in the window of the removed virtual volume which has just been unmounted, it just redirects to the User's home directory.  I think that behavior would be acceptable for removing physical media too.  I'm a bit confused as to why the behaviors differ.
Comment 11 Luke Symes 2010-02-16 22:01:40 UTC
Created attachment 153969 [details] [review]
Fixes existing check for if window should be closed.

This patch checks if a window is displaying or has displayed (in history) the root folder of the mount using g_file_equal in addition to the existing g_file_has_prefix checks. Note that this change along with the *existing* code only closes windows who have navigated solely around the mount. If you have navigated anywhere else in the window it won't be closed.
Comment 12 Alexander Larsson 2010-02-22 09:55:42 UTC
pushed.