Skip to content

0.31 API proposal: bounded transfers and portal-backed file drops #4790

Closed as not planned

Description

@mockydevs

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.

  1. 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.
  2. 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

  1. benandez commented on Oct 22, 2026

    @benandez

    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:

    An application-side resolver would suit us equally well. If winit exposes the raw application/vnd.portal.filetransfer payload, we can call org.freedesktop.portal.FileTransfer.RetrieveFiles ourselves. Either way works. libdbus is the option we'd rather avoid.

    Thanks for pushing Wayland drops forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions