Repository navigation
Description
I am migrating a downstream egui/VectorCraft app to current 0.31 master.
Before proposing the larger API changes as PRs, I would like feedback on two
transfer requirements. This targets 0.31, not a 0.30 backport.
- A drop or clipboard source can keep a transfer pipe open indefinitely or
send an arbitrarily large payload. Checking size in the adapter happens
after winit has buffered it. Could fetch_data_transfer support an explicit
byte limit and deadline, with asynchronous InvalidData/TimedOut results?
A backend unable to enforce limits should report unsupported rather than
silently perform an unlimited read. - A GTK file drop into an installed Flatpak can advertise
application/vnd.portal.filetransfer instead of usable host paths. Could
an opt-in Wayland feature resolve the capability after Drop and expose the
resulting local URIs through TypeHint::UriList? Explicit raw MIME requests
would remain raw. An application-side resolver is another possible design.
Working prototype: https://github.com/mockydevs/winit/tree/prototype/native-wayland-031
(commit 4c38d2f). It uses nonblocking bounded reads, a calloop deadline, bounded
portal workers and response sizes, and never acknowledges a failed transfer as
successful. Its optional portal implementation currently uses libdbus; that
dependency choice and the public API are proposals, not settled designs.
Local Linux validation passed with an isolated protocol server: overlapping
drops, cancellation, unsupported actions, malformed/remote/NUL paths, oversized
and stalled writers, clipboard paste after a drop, and a real document portal.
A downstream installed Flatpak received GTK-serialized capabilities, could not
read the originals before the drop, then imported images with matching content.
New artboards preserved 1:1 and 3:2 ratios; existing artboards and Undo/Redo worked.
A full native Wayland app launch and PhotoCraft save-back also passed. A physical
Nautilus drag gesture has not been tested; no private artwork is included.
The small prerequisites are separate: #4788 fixes MIME parsing;
Smithay/client-toolkit#546 preserves dropped offers during a later Enter.
I can split the prototype into focused lifecycle, limits and portal PRs after
agreement on the API and which layer should own capability resolution.
Activity
benandez commentedon Oct 22, 2026
I maintain packaging for the storytold craft apps (egui/eframe on winit), so this is a downstream view on the dependency question.
We'd strongly prefer that portal file drops don't pull in libdbus:
rfdit's in every app, so using it would add no new crate for us. That's probably true for most eframe apps that use native file dialogs.libdbus-1-devon every build path, including cross builds (we build riscv64) and Nix/FreeBSD. It's also a runtimelibdbus-1.so.3dependency in every deb, rpm, Arch, AppImage and Flatpak package. We tried it and reverted it (Revert "Install target libdbus headers for Linux portal builds (#57)" storytold/craft-common-actions#65).An application-side resolver would suit us equally well. If winit exposes the raw
application/vnd.portal.filetransferpayload, we can callorg.freedesktop.portal.FileTransfer.RetrieveFilesourselves. Either way works. libdbus is the option we'd rather avoid.Thanks for pushing Wayland drops forward.