Repository navigation
Replies: 1 comment
|
https://crates.io/crates/bevy_macos_open_files has what you need, until winit 0.31 releases. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'm developing a GUI application with Bevy and bevy_egui, and I'm using cargo-packager to create both Windows and macOS packages. My application uses a custom file extension.
On Windows, when a user double-clicks one of these files, the file path is correctly passed to the application as a command-line argument. I can then read this argument and open the file without any issues.
On macOS, however, the behavior is different. While the app is correctly associated with the custom file type and launches when I double-click a file, it does not receive the file path. Instead, macOS displays the following error message:
"The document “test_file.myext” could not be opened. cannot open files in the "” format."
I understand that macOS handles these file-opening events through specific Apple Events (specifically the open-file event) rather than command-line arguments.
My question is: what is the correct or recommended way to listen for and handle this open-file event within a Bevy application?
Any guidance on how to properly implement this would be greatly appreciated.
Thank you.
All reactions