[GTK] Receive dropped files using the File Transfer portal#25575
Conversation
|
EWS run on previous version of this PR (hash 00b3d58) Details
|
There was a problem hiding this comment.
I really dislike this. Suggestions welcomed.
I tried adding SelectionData::addGFiles but for apparently there must be a corresponding file:// URI for every reported file.
There was a problem hiding this comment.
I'm not sure if this kind of modification / sanitization is allowed
There was a problem hiding this comment.
I'm not sure I understand what you are doing here.
There was a problem hiding this comment.
This block of code basically filters out file://s from the URI list.
The URI list comes as a continuous string separated by \n. So I break the URI string by newline; filter out file:// URIs; and rebuild the (continuous) list in m_uriListBuilder.
After both mimetypes and the GdkFileList are processed, I merge the GFiles as file:// URIs into the URI list.
There was a problem hiding this comment.
I'm not sure I understand what you are doing here.
00b3d58 to
d51e8fd
Compare
|
EWS run on previous version of this PR (hash d51e8fd) Details
|
d51e8fd to
ff4a631
Compare
|
EWS run on previous version of this PR (hash ff4a631) Details |
ff4a631 to
e7049ee
Compare
|
EWS run on current version of this PR (hash e7049ee) Details
|
https://bugs.webkit.org/show_bug.cgi?id=212079 Reviewed by Carlos Garcia Campos. GTK4 has content serializers and deserializers that are able to read from, and write to, the File Transfer portal. They're used when using the high level content formats API, i.e. using GTypes. In particular, GTK4 is able to convert from "application/vnd.portal.filetransfer" (and the legacy "application/vnd.portal.files") from and into GdkFileLists. The DropTargetGtk4 code did not advertise the GdkFileList GType as a potential data offering, so GTK4 was never able to let the File Transfer portal conversion happen. Add the GdkFileList GType to the content formats. This creates a small conflict: many apps, e.g. Nautilus, advertise files both as "application/vnd.portal.filetransfer", and as "text/uri-list". The file URIs under "text/uri-list" are meaningless to sandboxed apps, as they might be in innaccessible locations. Which is why I've made the executive decision to ignore "file://" URIs when the File Transfer portal is used. Other types of URIs are preserved. (Other browsers take a more radical approach of ignoring all URIs on the presence of the File Transfer portal vendor.) * Source/WebKit/UIProcess/API/gtk/DropTarget.h: * Source/WebKit/UIProcess/API/gtk/DropTargetGtk4.cpp: (WebKit::DropTarget::DropTarget): (WebKit::DropTarget::accept): (WebKit::DropReadAsyncData::DropReadAsyncData): (WebKit::DropTarget::loadData): (WebKit::DropTarget::didLoadData): Canonical link: https://commits.webkit.org/275908@main
e7049ee to
ff20e45
Compare
|
Committed 275908@main (ff20e45): https://commits.webkit.org/275908@main Reviewed commits have been landed. Closing PR #25575 and removing active labels. |
🧪 mac-AS-debug-wk2
ff20e45
e7049ee
🛠 ios🛠 mac🛠 wpe🛠 wincairo🛠 mac-AS-debug🧪 wpe-wk2🧪 webkitperl🧪 ios-wk2🧪 api-mac🧪 api-wpe🧪 ios-wk2-wpt🧪 mac-wk1🛠 wpe-skia🧪 api-ios🧪 mac-wk2🛠 gtk🛠 tv🧪 mac-AS-debug-wk2🧪 gtk-wk2🛠 tv-sim🧪 mac-wk2-stress🧪 api-gtk🛠 watch🛠 watch-sim