native-dialog-rs icon indicating copy to clipboard operation
native-dialog-rs copied to clipboard

When used with iced-rs on macos, an error occurs.

Open myyrakle opened this issue 1 year ago • 1 comments

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?

source code

myyrakle avatar Sep 15 '24 14:09 myyrakle

Looks like that it's Apple's fault...

https://stackoverflow.com/a/75540727

balthild avatar May 01 '25 14:05 balthild