[webkit-changes] [WebKit/WebKit] ff20e4: [GTK] Receive dropped files using the File Transfe...
Georges Basile Stavracas Neto
noreply at github.com
Mon Mar 11 09:13:26 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ff20e457cb9cfffad9d1a6b9ccc9bb8a8537fb89
https://github.com/WebKit/WebKit/commit/ff20e457cb9cfffad9d1a6b9ccc9bb8a8537fb89
Author: Georges Basile Stavracas Neto <feaneron at igalia.com>
Date: 2024-03-11 (Mon, 11 Mar 2024)
Changed paths:
M Source/WebKit/UIProcess/API/gtk/DropTarget.h
M Source/WebKit/UIProcess/API/gtk/DropTargetGtk4.cpp
Log Message:
-----------
[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
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list