Skip to content

Use GtkFileChooserNative to take advantage of the Flatpak file selection portal #46

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

Open
aperezdc opened this issue Mar 7, 2017 · 4 comments

Comments

@aperezdc
Copy link
Owner

aperezdc commented Mar 7, 2017

Instead of letting WebKitGTK+ use GtkFileChooserDialog, Revolt should connect to WebKitWebView::run-file-chooser and use GtkFileChooserNative. The main motivation for this is enabling usage of the file chooser portal when running inside the Flatpak sandbox.

@aperezdc
Copy link
Owner Author

aperezdc commented Mar 7, 2017

I am trying to get WebKitGTK+ to use GtkFileChooserNative directly. If the patches are accepted upstream, there would be nothing to do in Revolt. Unless we want to provide a fall-back for using with older WebKitGTK+ versions.

@aperezdc
Copy link
Owner Author

aperezdc commented Mar 16, 2017

My patch was accepted upstream, but it would still be nice to provide a fallback for people using older releases of WebKitGTK+, we can use something like:

WEBKIT_VERSION = (WebKit2.get_major.version(),
                  WebKit2.get_minor_version(),
                  WebKit2.get_micro_version())

if WEBKIT_VERSION <= (2, 14, 5):
    # Connect to WebKitWebView::run-file-chooser

@aperezdc
Copy link
Owner Author

Using GNOME 3.26, for example using the Flatpak build as of commit 0ec092f400dd, is already using portals, thanks to the updated WebKitGTK+ 2.18, saving for issue #81.

@indolering
Copy link

Can we remove the "--filesystem=xdg-documents" and "--filesystem=xdg-pictures" permissions? Riot and WebKitGTK both suck in terms of security.

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

No branches or pull requests

2 participants