diff --git a/pot-browser/Cargo.toml b/pot-browser/Cargo.toml index 208b6e8b3..029a4988b 100644 --- a/pot-browser/Cargo.toml +++ b/pot-browser/Cargo.toml @@ -20,12 +20,14 @@ egui-toast.workspace = true chrono.workspace = true lru = "0.10.0" pulldown-cmark = "0.9.2" -rfd = "0.11.3" dirs = "5.0.1" crossbeam-channel.workspace = true strum.workspace = true swell-ui.workspace = true bytesize.workspace = true +[target.'cfg(target_os = "macos")'.dependencies] +rfd = "0.11.3" + [target.'cfg(any(all(target_os = "windows", target_arch = "x86_64"), target_os = "macos"))'.dependencies] opener = { version = "0.6.1", features = ["reveal"] } diff --git a/pot-browser/src/pot_browser_panel.rs b/pot-browser/src/pot_browser_panel.rs index f89c8101d..e2539a773 100644 --- a/pot-browser/src/pot_browser_panel.rs +++ b/pot-browser/src/pot_browser_panel.rs @@ -1970,7 +1970,7 @@ fn add_filter_panels( ui.close_menu(); let folder = { // On macOS, the blocking file dialog works nicely. - #[cfg(target_family = "unix")] + #[cfg(target_os = "macos")] { rfd::FileDialog::new().pick_folder() } @@ -1978,7 +1978,9 @@ fn add_filter_panels( // with reentrancy in baseview. Tried async dialog as well with main thread // dispatcher but that closes Pot Browser after choosing file. So we fall back to // manual entry of project path. - #[cfg(target_family = "windows")] + // On some Linux distributions (especially those used in cross 2.5) we don't + // have an up-to-date glib but rfd uses glib-sys and this one needs a new glib. + #[cfg(any(target_os = "windows", target_os = "linux"))] { Some(dirs::document_dir().unwrap_or_else(|| Reaper::get().resource_path())) }