-
Notifications
You must be signed in to change notification settings - Fork 94
Description
I also posted this on Soloud's issue tracker as I don't know where the problem could be: MoAlyousef/soloud-rs#40
Describe the bug
When an instance of Soloud is created it appears that RustyFileDialog is unable to create dialogs.
To Reproduce
I can only reproduce this on Windows, and partially reproduce this on Linux under Wine:
Windows just cargo run --bin playground. On Linux build with cargo build --bin playground --target=x86_64-pc-windows-gnu && wine target/x86_64-pc-windows-gnu/debug/playground.exe.
I say partially because the POC below seems to just work under Wine (but not on Windows) but my full project definitely still fails
My full project is under https://github.com/CasualX/chipgame, checkout 0fe12e before I implemented workaround. On windows: cargo run --bin chipedit. On linux: cargo build --bin chipedit --target=x86_64-pc-windows-gnu && wine target/x86_64-pc-windows-gnu/debug/chipedit.exe. This builds and runs the level editor. Press F2 or F5 to open load and save dialogs but they won't appear.
Below is a minimal reproduction:
[package]
name = "playground"
version = "0.1.0"
edition = "2021"
[dependencies]
soloud = "1.0"
rfd = { version = "0.16", default-features = false }Source code:
fn main() {
// 1) rfd before SoLoud init
let path_before = rfd::FileDialog::new()
.set_title("Before SoLoud")
.pick_file();
eprintln!("Dialog BEFORE SoLoud: {path_before:?}");
// 2) Initialize SoLoud
let _sl = soloud::Soloud::default().expect("Failed to create SoLoud");
// 3) rfd after SoLoud init
let path_after = rfd::FileDialog::new()
.set_title("After SoLoud")
.pick_file();
eprintln!("Dialog AFTER SoLoud: {path_after:?}");
}First dialog shows up just fine, after Soloud instance is created the 2nd dialog silently fails and just returns None as the path_after.
Expected behavior
I expect RFD to just work together with Soloud.