native-dialog-rs
native-dialog-rs copied to clipboard
When used with iced-rs on macos, an error occurs.
I wrote code to call a dialog when a button is pressed in a Mac Application. The code is as follows:
use std::path::PathBuf;
use native_dialog::FileDialog;
pub fn open_directory_dialog() -> anyhow::Result<PathBuf> {
let path = FileDialog::new().show_open_single_dir()?;
let path = match path {
Some(path) => path,
None => {
return Err(anyhow::anyhow!("No directory selected"));
}
};
println!("Selected file: {:?}", path);
Ok(path)
}
However, when I call that code, the following error occurs:
2024-09-15 23:23:35.147 musica[60974:2957668] +[CATransaction synchronize] called within transaction
I think this is probably a side effect of using it with iced-rs. This is because it ran fine when called without iced-rs started.
I'm curious as to which side this is causing the problem. Which direction should we approach to solve it?
Looks like that it's Apple's fault...
https://stackoverflow.com/a/75540727