Flatpak is a framework for distributing desktop applications across various 
Linux distributions, that runs each application into its own sandbox to limit 
its access to the host environment to the strict minimum, including access to 
the network, HW devices or the host file system.
To do so, it provides a specific set of APIs, known as "XDG Desktop Portal " 
that the guest application must be aware of to take full advantage of ; which 
is not the case for Java/JavaFX based applications.

Fortunately, some level of support for XDG Desktop Portal is baked into GTK3, 
which JavaFX could easily take advantage of.
One such opportunity is replace explicit uses of GtkFileChooserDialog with 
GtkFileChooserNative.

GtkFileChooserNative is an abstraction of a dialog box suitable for use with 
"File/Open" or "File/Save as" commands. By default, this just uses a 
GtkFileChooserDialog to implement the actual dialog. However, on certain 
platforms, such as Windows and macOS, the native platform file chooser is used 
instead. 
When the application is running in a sandboxed environment without direct 
filesystem access (such as Flatpak), GtkFileChooserNative may call the proper 
APIs (portals) to let the user choose a file and make it available to the 
application.

-------------

Commit messages:
 - Use GtkFileChooserNative instead of GtkFileChooserDialog for file picker 
dialogs in gtk based glass

Changes: https://git.openjdk.org/jfx/pull/2025/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2025&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8374630
  Stats: 15 lines in 1 file changed: 0 ins; 6 del; 9 mod
  Patch: https://git.openjdk.org/jfx/pull/2025.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/2025/head:pull/2025

PR: https://git.openjdk.org/jfx/pull/2025

Reply via email to