AndrewBelt / osdialog

A cross platform wrapper for OS dialogs like file save, open, message boxes, inputs, color picking, etc.
Creative Commons Zero v1.0 Universal
122 stars 19 forks source link

Second argument of osdialog_file() has no effect on Windows #16

Closed MarcBoule closed 3 years ago

MarcBoule commented 3 years ago

When calling osdialog_file() on Windows, the path we supply as the second argument of the function does not seem to have any effect. From my understanding, we should be able to supply a path to which the file dialog should point to when opening, but it's not being used, the dialog seems to be using the OS's default, which is the last used path. The problem does not happen on Mac.

I observed this issue in a module that we are developing, but it can also be seen in Rack itself, using File->SaveAs. When we have opened another location using a file dialog window (I can be more precise if ever you need), when we then do File->New and then File->SaveAs, it will not point to asset::user("patches") (https://github.com/VCVRack/Rack/blob/v1/src/patch.cpp#L121), but it will point to the last used path. This can be a bit confusing when we have a specific location we want to point the user to.

I hope this can be considered, I think pull requests 7 and 15 are relevant to this, but I have not tested them.

AndrewBelt commented 3 years ago

Fixed in https://github.com/AndrewBelt/osdialog/commit/0ed6318c6ed8f8726f7c626cd535520dd4d126c5