-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GTK] Receive dropped files using the File Transfer portal
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
- Loading branch information
1 parent
b7e1e3c
commit ff20e45
Showing
2 changed files
with
93 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters