You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Portal: Make PickFolder() check that portal interface version is >=3 (#94)
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.
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,6 +256,8 @@ To use the portal implementation, add `-DNFD_PORTAL=ON` to the build command.
256
256
257
257
*Note: Setting a default path is not supported by the portal implementation, and any default path passed to NFDe will be ignored. This is a limitation of the portal API, so there is no way NFDe can work around it. If this feature is something you desire, please show your interest on https://github.com/flatpak/xdg-desktop-portal/pull/874.*
258
258
259
+
*Note 2: The folder picker is only supported on org.freedesktop.portal.FileChooser interface version >= 3, which corresponds to xdg-desktop-portal version >= 1.7.1. `NFD_PickFolder()` will query the interface version at runtime, and return `NFD_ERROR` if the version is too low.
260
+
259
261
### What is a portal?
260
262
261
263
Unlike Windows and MacOS, Linux does not have a file chooser baked into the operating system. Linux applications that want a file chooser usually link with a library that provides one (such as GTK, as in the Linux screenshot above). This is a mostly acceptable solution that many applications use, but may make the file chooser look foreign on non-GTK distros.
0 commit comments