-
Notifications
You must be signed in to change notification settings - Fork 15k
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
[wip] feat: use GtkFileChooserNative for GTK File Dialog #15293
Conversation
GtkFileChooserNative has support for FileChooser XDG Portal. That allows for native file open/save dialogs on GTK and QT/Plasma environments. Signed-off-by: Denis Falqueto <denisf@trt3.jus.br>
💖 Thanks for opening this pull request! 💖 We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little unsure about the use case for this patch and would like to get some discussion on it before it's merged.
First, this is a first submitter patch and I'm always happy to see people improving Linux support, so I'm happy to see this patch.
But I'm not certain it's wise to require GTK+ 3.20 or higher, as that would break out-of-the-box support for Ubuntu 16.04 and older.
I'm also not sure what the use case for this patch is: Electron apps running on Windows or macOS likely won't be using ui/file_dialog_gtk.cc
in the first place, and so wouldn't the native support be moot?
@ckerr GTK+ provides a mechanism for indirecting native dialogs through a desktop-provided out-of-process common dialog handler when There are two main reasons to do this:
|
Would just have to be a run time check, thankfully its only two symbols. |
@TingPing, I'd be OK with a runtime check. How would this be done?
I suppose we could use dlopen + dlsym, but I'm not sure what the implications are of doing that when we already have a normal initialized GTK+ session? |
Yup. It is safe:
|
The electron/atom/browser/ui/file_dialog_gtk.cc Line 158 in 65bd2ff
(but the conversation about dynamically loading the symbols should probably be handled also) |
I didn't write this patch and I don't have the time or desire to compile Electron. I pointed out the (obvious) issue with this PR so I guess the author isn't interested. |
apologies, tagged the wrong person! @denisfalqueto ping, is there any progress on this? |
Closing as there has been no activity on this PR or response from the author. Happy to re-open should there be more activity! |
I am interested in picking this PR up. I am confused as to why we can't use https://developer.gnome.org/gtk3/stable/gtk3-Feature-Test-Macros.html#gtk-get-minor-version for checking if the minor version is >= 20. Can this not be checked at compile time? Do I need to run dlopen, dlsym to check the minor version because it can't be checked at compile time? This is an easy PR once that implementation detail is ironed out. |
I am going to fork electron and get to work on this. I am going to assume that I need to dynamically load the |
Please refer to PR #19159 |
Closes #2911.
GtkFileChooserNative has support for FileChooser XDG Portal.
That allows for native file open/save dialogs on GTK and QT/Plasma
environments.
Signed-off-by: Denis Falqueto denisf@trt3.jus.br
Checklist
npm test
passesRelease Notes
Notes: Use native file chooser dialog for opening and saving files.