Skip to content
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

GTK4 Support #24

Closed
btzy opened this issue Mar 23, 2021 · 3 comments · Fixed by #48 · May be fixed by #38
Closed

GTK4 Support #24

btzy opened this issue Mar 23, 2021 · 3 comments · Fixed by #48 · May be fixed by #38

Comments

@btzy
Copy link
Owner

btzy commented Mar 23, 2021

GTK4 has been released, we should eventually support it.

Most of the work has been done in #38 , but the major blocking issue is this. In summary, it is not possible to hide non-local files in the GTK4 file chooser (non-local files are those that do not have filepaths, such as resources on the Internet). We either have to filter the response and show an error message if non-local files are selected, or implement a shim to download those non-local files (not sure if this might be out of scope for NFD?).

Opinions on this issue are welcome.

@btzy btzy mentioned this issue Apr 23, 2021
@shenlebantongying
Copy link

shenlebantongying commented May 6, 2021

Sorry for interruption, but GTK is NOT "the" native Linux thing, and its file chooser is terrible (an example reason is that it doesn't have thumbnails for 18 years).

There is a new GtkFileChooserNative which can let users use to actual Native file choosers based on their own choice (like Dolphin for KDE, thundar for Xfce, or any file chooser for any desktop).

https://developer.gnome.org/gtk4/stable/GtkFileChooserNative.html

(If a popular application, which can runs on Linux, user your library, someday, someone will bother about it eventually.)

@btzy
Copy link
Owner Author

btzy commented May 6, 2021

Indeed it is not the native thing on some Linuxes, but it is a de-facto standard on the most common ones. The GTK3 implementation is based on the one in https://github.com/mlabbe/nativefiledialog. It appears that there is a workaround to make GTK open the KDE dialogs, by doing GTK_USE_PORTAL=1 when launching the application, though I'm not sure if it requires GtkFileChooserNative.

There is probably also another way, following mlabbe/nativefiledialog#40.

In any case, this should be a separate issue. I do not intend this GTK4 backend to work differently from the current GTK3 backend, though it may be possible to add some compilation flag in the future to use the native backend.

@btzy btzy changed the title GTK4 Support? GTK4 Support May 7, 2021
@OvermindDL1
Copy link

I noticed this was linked to nativefiledialog project and I left a post about the proper way to handle this, see it at: mlabbe/nativefiledialog#40 (comment)

but it is a de-facto standard on the most common ones

Absolutely not.

by doing GTK_USE_PORTAL=1 when launching the application, though I'm not sure if it requires GtkFileChooserNative

That option, if enabled in that gtk build, just makes it call out to that same listed dbus endpoint as in the above link instead of calling it natively. Best to just cut out the middleman and do it correctly so it works on all places properly everywhere for all DE's and you won't need to link to anything odd like kde or gtk or anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants