A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.
Rust archive-managerdesktop-appdual-paneexplorer-alternativefile-browserfile-explorerfile-managerfluent-designgpu-acceleratedgpuimacosmicaproductivityquick-lookrustrust-guitabswindowswindows-11windows-explorer
Panes on a drive that is gone go Home (764)
gelenmedyaedecbde7a34d
diff --git a/crates/rf-app/src/places.rs b/crates/rf-app/src/places.rsindex 47a6a3b3..633509ef 100644--- a/crates/rf-app/src/places.rs+++ b/crates/rf-app/src/places.rs@@ -636,6 +636,19 @@ impl Places {let pin_paths: Vec<PathBuf> = pinned.iter().flat_map(|p| crate::nav_touch::label_paths(&p.path)).collect();let pin_names = cx.background_spawn(async move { rf_win::localized::warm(pin_paths) });let _ = this.update(cx, |p, cx| {+ // A drive that is gone from the system (unplugged, ejected elsewhere) takes the panes on it Home, as our own eject does+ // (issue 764: Explorer closes such tabs; going Home keeps the window's tabs as they were). A drive only hidden from the+ // list is still there and is left alone.+ let gone: Vec<char> = p+ .drives+ .iter()+ .map(|d| d.letter)+ .filter(|l| !drives.iter().any(|d| d.letter == *l) && !rf_win::drives::letter_present(*l))+ .collect();+ for letter in gone {+ log::info!("places: {letter}: is gone; panes on it go Home");+ crate::workspace::release_drive(letter, cx);+ }p.pinned = pinned;p.drives = drives;p.libraries = libraries;diff --git a/crates/rf-win/src/drives.rs b/crates/rf-win/src/drives.rsindex b9b611b9..d850a8c1 100644--- a/crates/rf-win/src/drives.rs+++ b/crates/rf-win/src/drives.rs@@ -95,6 +95,13 @@ pub fn visible_drives() -> Vec<Drive> {list_drives_except(hidden() | policy_hidden())}+/// Whether drive letter `letter` exists in the system at all right now (one call, nothing is read from the drive): a drive the user+/// hides from the list still exists; an unplugged one does not.+pub fn letter_present(letter: char) -> bool {+ let l = letter.to_ascii_uppercase();+ l.is_ascii_uppercase() && unsafe { GetLogicalDrives() } & (1 << (l as u32 - 'A' as u32)) != 0+}+/// Lists drive letters. Volume info can stall on disconnected network / empty optical drives,/// so call this off the UI thread.pub fn list_drives() -> Vec<Drive> {