Skip to content

Commit

Permalink
Don't build with rfd on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Jul 5, 2023
1 parent dd8b803 commit 0b1ba15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pot-browser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
6 changes: 4 additions & 2 deletions pot-browser/src/pot_browser_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1970,15 +1970,17 @@ fn add_filter_panels<I: PotBrowserIntegration>(
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()
}
// On Windows, we run into the borrow_mut error because of RefCells combined
// 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()))
}
Expand Down

0 comments on commit 0b1ba15

Please sign in to comment.