When I try to implement the Gtk.FileChooser interface, I get the following error when compiling:
error: unknown type name ‘GtkFileChooserIface’
60 | static GtkFileChooserIface * app_custom_file_chooser_gtk_file_chooser_parent_iface = NULL;
| ^~~~~~~~~~~~~~~~~~~
CustomFileChooser.c:319:65: error: unknown type name ‘GtkFileChooserIface’; did you mean ‘GtkFontChooserIface’?
FileChooserNative probably works fine when using flatpak, but on normal launch in KDE it shows the GNOME dialog.
I have tried installing the xdg-desktop-portal-kde package and GTK_USE_PORTAL=1 but it doesn’t work.
I also tried using GDK_DEBUG=portals but that didn’t work either.
Thank you for saying that the FileChooser interface is private, I did not find this in the documentation.
With the new GtkFileDialog API in gtk 4.10, it should default to always using portals if they are available. (See gtk#5026.) But you will have to wait apps to port to this new API.
And along with that, FileChooser and FileChooserNative will be deprecated in 4.10.