btzy / nativefiledialog-extended

Cross platform (Windows, Mac, Linux) native file dialog library with C and C++ bindings, based on mlabbe/nativefiledialog.
zlib License
598 stars 89 forks source link

Portal: Make `PickFolder()` check that portal interface version is >=3 #94

Closed btzy closed 1 year ago

btzy commented 1 year ago

This makes NFD_PickFolder() check that the xdg-desktop-portal interface version is at least 3 before requesting for a folder picker. On earlier interface versions, it will return with an error.

This is because the directory flag on the OpenFile method of the portal was added in version 3. On earlier versions, this flag will be ignored, which will cause a file picker (instead of folder picker) to be opened instead, and this is unlikely to be an appropriate fallback.

Resolves #91.