Summary: | [GTK] Use GtkFileChooserNative for open/save dialogs | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Adrian Perez <aperez> | ||||||
Component: | WebKitGTK | Assignee: | Adrian Perez <aperez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | berto, bugs-noreply, cgarcia, commit-queue, gustavo, mcatanzaro, mrobinson, tpopela | ||||||
Priority: | P2 | ||||||||
Version: | Other | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Adrian Perez
2017-03-07 06:25:59 PST
Looks pretty easy, just need to update webkitWebViewRunFileChooser in WebKitWebView.cpp. Looks like it has no support for MIME types filter, though? That's a shame. (In reply to comment #1) > Looks pretty easy, just need to update webkitWebViewRunFileChooser in > WebKitWebView.cpp. > > Looks like it has no support for MIME types filter, though? That's a shame. I am already making a test build with locally with the needed changes applied; I will attach it to the bug soon. Regarding the filters, from the documentation (linked in the bug description) my interpretation is that: - MIME-type based filters are supported by the Flatpak portal chooser implementation. We are only using this kind of filter in WebKitGTK+ (good!). - No filters at all are supported in the Windows implementation. When using filters GtkFileChooserNative automatically falls-back to using GtkFileChooserDialog. Not like we care right now, as we are lacking in the Windows support department, but if somebody made WebKitGTK+ work in Windows, it seems reasonable to use GtkFileChooserNative and let it trigger the fall-back code path when needed. TL;DR: We will be fine as we are only using MIME-type based filters. Created attachment 303653 [details]
Patch
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API Comment on attachment 303653 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=303653&action=review LGTM. Carlos Garcia will want to review it as well. > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:569 > + // XXX: Using a filter based on MIME types does not work in Windows. If such a filter is > + // set, GtkFileChooserNative automatically falls-back to using GtkFileChooserDialog. That's not our problem. We don't even support Windows. You can remove this comment. Note: this is required for our goal to release Flatpaks. Created attachment 303817 [details]
Patch
(In reply to comment #5) > Comment on attachment 303653 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=303653&action=review > > LGTM. Carlos Garcia will want to review it as well. > > > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:569 > > + // XXX: Using a filter based on MIME types does not work in Windows. If such a filter is > > + // set, GtkFileChooserNative automatically falls-back to using GtkFileChooserDialog. > > That's not our problem. We don't even support Windows. You can remove this > comment. Comment removed. It should be good to go now :-) Comment on attachment 303817 [details] Patch Clearing flags on attachment: 303817 Committed r213637: <http://trac.webkit.org/changeset/213637> All reviewed patches have been landed. Closing bug. |