Skip to content

Save file dialog: Cannot set default file name #13014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
GameParrot opened this issue May 12, 2025 · 4 comments
Open

Save file dialog: Cannot set default file name #13014

GameParrot opened this issue May 12, 2025 · 4 comments
Milestone

Comments

@GameParrot
Copy link

Currently, there is not a way to set the default file name of a save file dialog. Would it be possible to add a property for the default file name?

@slouken slouken added this to the 3.4.0 milestone May 12, 2025
@Semphriss
Copy link
Contributor

Which platform have you tested on? Normally, SDL_PROP_FILE_DIALOG_LOCATION_STRING or the location argument should allow providing a default file name, like /path/to/folder/file.ext should open the dialog at /path/to/folder/ and prefill file.ext. #13007 found that the XDG Portal implementation didn't do that already and provided an implementation; if another platform misses that, it should be fixed.

@GameParrot
Copy link
Author

Which platform have you tested on? Normally, SDL_PROP_FILE_DIALOG_LOCATION_STRING or the location argument should allow providing a default file name, like /path/to/folder/file.ext should open the dialog at /path/to/folder/ and prefill file.ext. #13007 found that the XDG Portal implementation didn't do that already and provided an implementation; if another platform misses that, it should be fixed.

If SDL_PROP_FILE_DIALOG_LOCATION_STRING is set to just file.ext should it just set the name and keep the default location

@Semphriss
Copy link
Contributor

If SDL_PROP_FILE_DIALOG_LOCATION_STRING is set to just file.ext should it just set the name and keep the default location

Which platform have you tested on? This is the expected behavior on all platforms. I just double-checked with Windows and it's the observed behavior; only the Linux implementation (XDG Portals) have a known bug that will be fixed with #13007. If there's another platform that doesn't work as you wrote, please send the details so I can work on a fix.

@GameParrot
Copy link
Author

GameParrot commented May 15, 2025

If SDL_PROP_FILE_DIALOG_LOCATION_STRING is set to just file.ext should it just set the name and keep the default location

Which platform have you tested on? This is the expected behavior on all platforms. I just double-checked with Windows and it's the observed behavior; only the Linux implementation (XDG Portals) have a known bug that will be fixed with #13007. If there's another platform that doesn't work as you wrote, please send the details so I can work on a fix.

I think it might not be implemented properly on macOS
Can confirm it is broken on linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants