-
Notifications
You must be signed in to change notification settings - Fork 561
8374630: Replace GtkFileChooserDialog with GtkFileChooserNative to allow for better Flatpak integration #2025
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
base: master
Are you sure you want to change the base?
Conversation
…ker dialogs in gtk based glass
|
👋 Welcome back fthevenet! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
It's a small change but we'll have to thoroughly test it before integrating. I'll take a look at it, but a second pair of eyes will be needed for verification on Linux. /reviewers 2 |
|
@lukostyra |
|
@azvegint Can you take a look at this? |
|
Thanks for looking into this, @lukostyra Here's a thing that I noticed during my own testing that might be of interest: I have verified that when running a test app as a standard process, the file chooser dialog resulting from calling There is, however, a visible difference in what is produced by this implementation compared to the previous one in JavaFX: the "Open/Save" and "Cancel" buttons do not show an icon besides the label: The reason for that is that I looked, but couldn't find an alternative way to add the icon in the new implementation (not that I personally think it is a big loss, but ideally this change shouldn't introduce any visual differences when used in the same context). I have, however, verified that passing |
|
This works as expected. I will have a deeper look though, as there might be edge cases that I'm missing. Also, the comment above related to label/icon needs more investigation. |
|
I had a deeper look. All code changes look fine, and I believe it is the right thing to do (including the support for flatpak) I'm pretty neutral on design in general, but it seems that removing the option to show an icon next to the label is aligning us more with industry standards. Since this is about an OS/Gnome component, I believe there is no problem if this results (on some systems) in a changed UI -- other apps will probably show similar evolution. |
|
Thanks @johanvos I took those screenshot on Fedora 43 (with KDE 6.5.4). The version of the bundled GTK3 libs is 3.24.51. Another issue I've noticed with these icons is that if I run a light color theme on my env, the icons are still there but almost invisible, as they are drawn in white on a very light grey background:
If you click the button so its background color changes, you can see the icon it still there:
Maybe this is what's happening on your machine, @johanvos ? At any rate, for all the reasons you mentioned, I believe it's not really worth investigating this particular problem further and that simply getting rid of the icons is the best way forward. |
|
Any chances that this will make it to JavaFX 26, since we've now entered RDP1? |
|
This enhancement request seems better suited for JavaFX 27. We do use the same process as the JDK does for backporting. See this message. Enhancement requests need approval to be backported to JavaFX 26 during rampdown. You can make the request, but I don't think it is a good candidate for getting in late in the release cycle. |
|
Thanks for your reply. |




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.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/2025/head:pull/2025$ git checkout pull/2025Update a local copy of the PR:
$ git checkout pull/2025$ git pull https://git.openjdk.org/jfx.git pull/2025/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2025View PR using the GUI difftool:
$ git pr show -t 2025Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/2025.diff
Using Webrev
Link to Webrev Comment